1 1.17 andvar /* $NetBSD: e500reg.h,v 1.17 2022/05/24 20:50:18 andvar Exp $ */ 2 1.2 matt /*- 3 1.2 matt * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. 4 1.2 matt * All rights reserved. 5 1.2 matt * 6 1.2 matt * This code is derived from software contributed to The NetBSD Foundation 7 1.2 matt * by Raytheon BBN Technologies Corp and Defense Advanced Research Projects 8 1.2 matt * Agency and which was developed by Matt Thomas of 3am Software Foundry. 9 1.2 matt * 10 1.2 matt * This material is based upon work supported by the Defense Advanced Research 11 1.2 matt * Projects Agency and Space and Naval Warfare Systems Center, Pacific, under 12 1.2 matt * Contract No. N66001-09-C-2073. 13 1.2 matt * Approved for Public Release, Distribution Unlimited 14 1.2 matt * 15 1.2 matt * Redistribution and use in source and binary forms, with or without 16 1.2 matt * modification, are permitted provided that the following conditions 17 1.2 matt * are met: 18 1.2 matt * 1. Redistributions of source code must retain the above copyright 19 1.2 matt * notice, this list of conditions and the following disclaimer. 20 1.2 matt * 2. Redistributions in binary form must reproduce the above copyright 21 1.2 matt * notice, this list of conditions and the following disclaimer in the 22 1.2 matt * documentation and/or other materials provided with the distribution. 23 1.2 matt * 24 1.2 matt * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 25 1.2 matt * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 26 1.2 matt * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 27 1.2 matt * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 28 1.2 matt * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 1.2 matt * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 1.2 matt * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 1.2 matt * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 32 1.2 matt * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 1.2 matt * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34 1.2 matt * POSSIBILITY OF SUCH DAMAGE. 35 1.2 matt */ 36 1.2 matt 37 1.2 matt #include <sys/cdefs.h> 38 1.2 matt 39 1.2 matt #ifdef _LOCORE 40 1.2 matt #define __PPCBIT(n) (1 << (31 - (n))) 41 1.2 matt #define __PPCBITS(m, n) (((1 << ((n) - (m) + 1)) - 1) << (31 - (m))) 42 1.2 matt #else 43 1.2 matt #define __PPCBIT(n) __BIT(31-(n)) 44 1.2 matt #define __PPCBITS(m,n) __BITS(31-(n),31-(m)) 45 1.2 matt #endif 46 1.2 matt 47 1.2 matt #define GUR_SIZE 0x100000 48 1.7 matt #define GUR_BPTR 0x0020 /* Boot Page Translation */ 49 1.7 matt #define BPTR_EN __PPCBIT(0) /* Boot Page Enabled */ 50 1.7 matt #define BPTR_BOOT_PAGE __PPCBITS(8,31) /* high 24 bits of phys addr */ 51 1.2 matt 52 1.2 matt #define DDRC1_BASE 0x02000 53 1.2 matt #define DDRC2_BASE 0x06000 54 1.2 matt #define DDRC_SIZE 0x01000 55 1.2 matt 56 1.2 matt #ifdef DDRC_PRIVATE 57 1.2 matt #define CS_BNDS(n) (0x000 + 0x008 * (n)) 58 1.2 matt #define BNDS_SA __PPCBITS(4,15) 59 1.2 matt #define BNDS_SA_GET(n) (((n) & BNDS_SA) << 8) 60 1.2 matt #define BNDS_EA __PPCBITS(20,31) 61 1.2 matt #define BNDS_EA_GET(n) (((n) & BNDS_EA) << 24) 62 1.2 matt #define BNDS_SIZE_GET(n) \ 63 1.2 matt ((((((n) & BNDS_EA) + __LOWEST_SET_BIT(BNDS_EA)) << 16) - (((n) & BNDS_SA))) << 8) 64 1.2 matt #define CS_CONFIG(n) (0x080 + 0x004 * (n)) 65 1.2 matt #define CS_CONFIG_EN __PPCBIT(0) 66 1.10 matt 67 1.10 matt #define DDR_SDRAM_CFG 0x110 68 1.10 matt #define SDRAM_CFG_MEM_EN __PPCBIT(0) 69 1.10 matt #define SDRAM_CFG_SREN __PPCBIT(1) 70 1.10 matt #define SDRAM_CFG_ECC_EN __PPCBIT(2) 71 1.10 matt #define SDRAM_CFG_RDEN __PPCBIT(3) 72 1.10 matt #define SDRAM_CFG_TYPE __PPCBITS(5,7) 73 1.10 matt #define SDRAM_CFG_TYPE_DDR2 3 74 1.10 matt #define SDRAM_CFG_TYPE_DDR3 7 75 1.10 matt #define SDRAM_CFG_DYN_PWR __PPCBIT(10) 76 1.10 matt #define SDRAM_CFG_DBW __PPCBITS(11,12) 77 1.10 matt #define SDRAM_CFG_DBW_64BIT 0 78 1.10 matt #define SDRAM_CFG_DBW_32BIT 1 79 1.10 matt 80 1.10 matt #define CAPTURE_DATA_HI 0xe20 81 1.10 matt #define CAPTURE_DATA_LO 0xe24 82 1.10 matt #define CAPTURE_ECC 0xe28 83 1.10 matt 84 1.10 matt #define ERR_DETECT 0xe40 85 1.10 matt #define ERR_DISABLE 0xe44 86 1.10 matt #define ERR_INT_EN 0xe48 87 1.10 matt 88 1.10 matt #define ERR_MMEE __PPCBIT(0) 89 1.10 matt #define ERR_APEE __PPCBIT(23) 90 1.10 matt #define ERR_ACEE __PPCBIT(24) 91 1.10 matt #define ERR_MBEE __PPCBIT(28) 92 1.10 matt #define ERR_SBEE __PPCBIT(29) 93 1.10 matt #define ERR_MSEE __PPCBIT(31) 94 1.10 matt 95 1.10 matt #define CAPTURE_ATTRIBUTES 0xe4c 96 1.10 matt #define CATTR_BNUM __PPCBITS(1,3) 97 1.10 matt #define CATTR_TSIZ __PPCBITS(5,7) 98 1.10 matt #define CATTR_TSRC __PPCBITS(11,15) 99 1.10 matt #define CATTR_TTYP __PPCBITS(18,19) 100 1.10 matt #define CATTR_VLD __PPCBIT(31) 101 1.10 matt 102 1.10 matt #define CAPTURE_ADDRESS 0xe50 103 1.10 matt #define CAPTURE_EXT_ADDRESS 0xe54 104 1.10 matt 105 1.10 matt #define ERR_SBE 0xe58 106 1.10 matt #define ERR_SBE_SBET __PPCBITS(8,15) 107 1.10 matt #define ERR_SBE_SBEC __PPCBITS(24,31) 108 1.10 matt 109 1.2 matt #endif /* DDRC_PRIVATE */ 110 1.2 matt 111 1.2 matt #define GPIO_BASE 0x0fc00 112 1.2 matt #define GPIO_SIZE 0x00020 113 1.2 matt 114 1.2 matt #ifdef GPIO_PRIVATE 115 1.2 matt 116 1.2 matt #define GPDIR 0x00 /* GPIO direction register */ 117 1.2 matt #define GPODR 0x04 /* GPIO open drain register */ 118 1.2 matt #define GPDAT 0x08 /* GPIO data register */ 119 1.2 matt #define GPIER 0x0C /* GPIO interrupt event register */ 120 1.2 matt #define GPIMR 0x10 /* GPIO interrupt mask register */ 121 1.2 matt #define GPICR 0x14 /* GPIO external interrupt control register */ 122 1.2 matt 123 1.2 matt #endif /* GPIO_PRIVATE */ 124 1.2 matt 125 1.2 matt #define PCIE1_BASE 0x0a000 126 1.3 matt #define PCIE2_MPC8572_BASE 0x09000 /* P2020 too */ 127 1.3 matt #define PCIE3_MPC8572_BASE 0x08000 /* P2020 too */ 128 1.2 matt #define PCIX1_MPC8548_BASE 0x08000 129 1.2 matt #define PCIX2_MPC8548_BASE 0x09000 130 1.2 matt #define PCIE2_MPC8544_BASE 0x09000 /* MPC8536 too */ 131 1.2 matt #define PCIE3_MPC8544_BASE 0x0b000 /* MPC8536 too */ 132 1.2 matt #define PCIX1_MPC8544_BASE 0x08000 /* MPC8536 too */ 133 1.2 matt #define PCI_SIZE 0x01000 134 1.2 matt 135 1.2 matt #ifdef PCI_PRIVATE 136 1.2 matt 137 1.2 matt /* PCI Express Configuration Access Registers */ 138 1.2 matt #define PEX_CONFIG_ADDR 0x000 /* PCI Express configuration address register */ 139 1.2 matt #define PCI_CONFIG_ADDR PEX_CONFIG_ADDR 140 1.2 matt #define PEX_CONFIG_ADDR_EN __PPCBIT(0) 141 1.2 matt #define PEX_CONFIG_ADDR_TAG(b,d,f,r) (((b) << 16) | ((d) << 11) | ((f) << 8) | (r)) 142 1.2 matt #define PEX_CONFIG_DATA 0x004 /* PCI Express configuration data register */ 143 1.2 matt #define PCI_CONFIG_DATA PEX_CONFIG_DATA 144 1.2 matt #define PCI_INT_ACK 0x008 /* PCI Interrupt Acknowledge */ 145 1.2 matt #define PEX_OTB_CPL_TOR 0x00C /* PCI Express outbound completion timeout register */ 146 1.2 matt #define PEX_CONF_RTY_TOR 0x010 /* PCI Express configuration retry timeout register */ 147 1.2 matt #define PEX_CONFIG 0x014 /* PCI Express configuration register */ 148 1.2 matt 149 1.2 matt /* PCI Express Power Management Event & Message Registers */ 150 1.2 matt #define PEX_PME_MES_DR 0x020 /* PCI Express PME & message detect register */ 151 1.2 matt #define PEX_PME_MES_DISR 0x024 /* PCI Express PME & message disable register */ 152 1.2 matt #define PEX_PME_MES_IER 0x028 /* PCI Express PME & message interrupt enable register */ 153 1.2 matt #define PEX_PMCR 0x02C /* PCI Express power management command register */ 154 1.2 matt 155 1.2 matt /* PCI Express IP Block Revision Registers */ 156 1.2 matt #define PEX_IP_BLK_REV1 0xBF8 /* IP block revision register 1 */ 157 1.2 matt #define PEX_IP_BLK_REV2 0xBFC /* IP block revision register 2 */ 158 1.2 matt 159 1.2 matt /* PCI Express / PCI-X ATMU Registers */ 160 1.2 matt #define PEXOWAR_EN __PPCBIT(0) /* enable window */ 161 1.2 matt #define PEXOWAR_ROE __PPCBIT(3) /* relaxed ordering enable */ 162 1.2 matt #define PEXOWAR_NS __PPCBIT(4) /* no snoop enable */ 163 1.2 matt #define PEXOWAR_TC __PPCBITS(8,10) /* traffic class PCIEX only */ 164 1.2 matt #define PEXOWAR_TC0 __SHIFTIN(0, PEXOWAR_TC) 165 1.2 matt #define PEXOWAR_TC1 __SHIFTIN(1, PEXOWAR_TC) 166 1.2 matt #define PEXOWAR_TC2 __SHIFTIN(2, PEXOWAR_TC) 167 1.2 matt #define PEXOWAR_TC3 __SHIFTIN(3, PEXOWAR_TC) 168 1.2 matt #define PEXOWAR_TC4 __SHIFTIN(4, PEXOWAR_TC) 169 1.2 matt #define PEXOWAR_TC5 __SHIFTIN(5, PEXOWAR_TC) 170 1.2 matt #define PEXOWAR_TC6 __SHIFTIN(6, PEXOWAR_TC) 171 1.2 matt #define PEXOWAR_TC7 __SHIFTIN(7, PEXOWAR_TC) 172 1.2 matt #define PEXOWAR_RTT __PPCBITS(12,15) /* read transaction type */ 173 1.2 matt #define PEXOWAR_RTT_CONF __SHIFTIN(2, PEXOWAR_RTT) /* PCIEX only */ 174 1.2 matt #define PEXOWAR_RTT_MEM __SHIFTIN(4, PEXOWAR_RTT) 175 1.2 matt #define PEXOWAR_RTT_IO __SHIFTIN(8, PEXOWAR_RTT) 176 1.2 matt #define PEXOWAR_WTT __PPCBITS(16,19) /* write transaction type */ 177 1.2 matt #define PEXOWAR_WTT_CONF __SHIFTIN(2, PEXOWAR_WTT) /* PCIEX only */ 178 1.2 matt #define PEXOWAR_WTT_MEM __SHIFTIN(4, PEXOWAR_WTT) 179 1.2 matt #define PEXOWAR_WTT_IO __SHIFTIN(8, PEXOWAR_WTT) 180 1.2 matt #define PEXOWAR_OWS __PPCBITS(26,31) /* encoded as 2^(N+1) bytes */ 181 1.2 matt 182 1.2 matt /* PCI Express / PCI-X ATMU Registers */ 183 1.2 matt #define PEXIWAR_EN __PPCBIT(0) /* enable window */ 184 1.2 matt #define PEXIWAR_PF __PPCBIT(3) /* prefetchable */ 185 1.2 matt #define PEXIWAR_TRGT __PPCBITS(8,11) /* traffic class PCIEX only */ 186 1.2 matt #define PEXIWAR_TRGT_PCI1 __SHIFTIN(0, PEXIWAR_TRGT) 187 1.2 matt #define PEXIWAR_TRGT_PCI2 __SHIFTIN(1, PEXIWAR_TRGT) 188 1.2 matt #define PEXIWAR_TRGT_PCIEX __SHIFTIN(2, PEXIWAR_TRGT) 189 1.2 matt #define PEXIWAR_TRGT_SRIO __SHIFTIN(12, PEXIWAR_TRGT) 190 1.2 matt #define PEXIWAR_TRGT_LOCALMEM __SHIFTIN(15, PEXIWAR_TRGT) 191 1.2 matt #define PEXIWAR_RTT __PPCBITS(12,15) /* read transaction type */ 192 1.2 matt #define PEXIWAR_RTT_MEM __SHIFTIN(4, PEXIWAR_RTT) 193 1.2 matt #define PEXIWAR_RTT_MEM_NOSNOOP __SHIFTIN(4, PEXIWAR_RTT) 194 1.2 matt #define PEXIWAR_RTT_MEM_SNOOP __SHIFTIN(5, PEXIWAR_RTT) 195 1.2 matt #define PEXIWAR_RTT_MEM_ULCKL2 __SHIFTIN(7, PEXIWAR_RTT) 196 1.2 matt #define PEXIWAR_WTT __PPCBITS(16,19) /* write transaction type */ 197 1.2 matt #define PEXIWAR_WTT_MEM_NOSNOOP __SHIFTIN(4, PEXIWAR_WTT) 198 1.2 matt #define PEXIWAR_WTT_MEM_SNOOP __SHIFTIN(5, PEXIWAR_WTT) 199 1.2 matt #define PEXIWAR_WTT_MEM_ALLOL2 __SHIFTIN(6, PEXIWAR_WTT) 200 1.2 matt #define PEXIWAR_WTT_MEM_ALCKL2 __SHIFTIN(7, PEXIWAR_WTT) 201 1.2 matt #define PEXIWAR_IWS __PPCBITS(26,31) /* encoded as 2^(N+1) bytes */ 202 1.2 matt #define PEXIWAR_IWS_GET(n) __SHIFTOUT((n), PEXIWAR_IWS) 203 1.2 matt 204 1.2 matt /* Outbound Window 0 (Default) */ 205 1.2 matt #define PEXOTAR0 0xC00 /* PCI Express outbound translation address register 0 (default) */ 206 1.2 matt #define PEXOTEAR0 0xC04 /* PCI Express outbound translation extended address register 0 (default) */ 207 1.2 matt #define PEXOWAR0 0xC10 /* PCI Express outbound window attributes register 0 (default) */ 208 1.2 matt 209 1.2 matt /* Outbound Window 1 */ 210 1.2 matt #define PEXOTAR1 0xC20 /* PCI Express outbound translation address register 1 */ 211 1.2 matt #define PEXOTEAR1 0xC24 /* PCI Express outbound translation extended address register 1 */ 212 1.2 matt #define PEXOWBAR1 0xC28 /* PCI Express outbound window base address register 1 */ 213 1.2 matt #define PEXOWAR1 0xC30 /* PCI Express outbound window attributes register 1 */ 214 1.2 matt 215 1.2 matt /* Outbound Window 2 */ 216 1.2 matt #define PEXOTAR2 0xC40 /* PCI Express outbound translation address register 2 */ 217 1.2 matt #define PEXOTEAR2 0xC44 /* PCI Express outbound translation extended address register 2 */ 218 1.2 matt #define PEXOWBAR2 0xC48 /* PCI Express outbound window base address register 2 */ 219 1.2 matt #define PEXOWAR2 0xC50 /* PCI Express outbound window attributes register 2 */ 220 1.2 matt 221 1.2 matt /* Outbound Window 3 */ 222 1.2 matt #define PEXOTAR3 0xC60 /* PCI Express outbound translation address register 3 */ 223 1.2 matt #define PEXOTEAR3 0xC64 /* PCI Express outbound translation extended address register 3 */ 224 1.2 matt #define PEXOWBAR3 0xC68 /* PCI Express outbound window base address register 3 */ 225 1.2 matt #define PEXOWAR3 0xC70 /* PCI Express outbound window attributes register 3 */ 226 1.2 matt 227 1.2 matt /* Outbound Window 4 */ 228 1.2 matt #define PEXOTAR4 0xC80 /* PCI Express outbound translation address register 4 */ 229 1.2 matt #define PEXOTEAR4 0xC84 /* PCI Express outbound translation extended address register 4 */ 230 1.2 matt #define PEXOWBAR4 0xC88 /* PCI Express outbound window base address register 4 */ 231 1.2 matt #define PEXOWAR4 0xC90 /* PCI Express outbound window attributes register 4 */ 232 1.2 matt 233 1.2 matt /* Inbound Window 3 */ 234 1.2 matt #define PEXITAR3 0xDA0 /* PCI Express inbound translation address register 3 */ 235 1.2 matt #define PEXIWBAR3 0xDA8 /* PCI Express inbound window base address register 3 */ 236 1.2 matt #define PEXIWBEAR3 0xDAC /* PCI Express inbound window base extended address register 3 */ 237 1.2 matt #define PEXIWAR3 0xDB0 /* PCI Express inbound window attributes register 3 */ 238 1.2 matt 239 1.2 matt /* Inbound Window 2 */ 240 1.2 matt #define PEXITAR2 0xDC0 /* PCI Express inbound translation address register 2 */ 241 1.2 matt #define PEXIWBAR2 0xDC8 /* PCI Express inbound window base address register 2 */ 242 1.2 matt #define PEXIWBEAR2 0xDCC /* PCI Express inbound window base extended address register 2 */ 243 1.2 matt #define PEXIWAR2 0xDD0 /* PCI Express inbound window attributes register 2 */ 244 1.2 matt 245 1.2 matt /* Inbound Window 1 */ 246 1.2 matt #define PEXITAR1 0xDE0 /* PCI Express inbound translation address register 1 */ 247 1.2 matt #define PEXIWBAR1 0xDE8 /* PCI Express inbound window base address register 1 */ 248 1.2 matt #define PEXIWAR1 0xDF0 /* PCI Express inbound window attributes register 1 */ 249 1.2 matt 250 1.2 matt /* PCI Express Error Management Registers */ 251 1.2 matt #define PEX_ERR_DR 0xE00 /* PCI Express error detect register */ 252 1.2 matt #define PEXERRDR_ICCA __PPCBIT(14) 253 1.2 matt #define PEX_ERR_EN 0xE08 /* PCI Express error interrupt enable register */ 254 1.2 matt #define PEX_ERR_DISR 0xE10 /* PCI Express error disable register */ 255 1.2 matt #define PEX_ERR_CAP_STAT 0xE20 /* PCI Express error capture status register */ 256 1.2 matt #define PEX_ERR_CAP_R0 0xE28 /* PCI Express error capture register 0 */ 257 1.2 matt #define PEX_ERR_CAP_R1 0xE2C /* PCI Express error capture register 1 */ 258 1.2 matt #define PEX_ERR_CAP_R2 0xE30 /* PCI Express error capture register 2 */ 259 1.2 matt #define PEX_ERR_CAP_R3 0xE34 /* PCI Express error capture register 3 */ 260 1.2 matt 261 1.2 matt /* PCI Express Private Configuration Space */ 262 1.2 matt 263 1.2 matt #define PEX_LTSSM 0x404 264 1.2 matt #define LTSSM_L0 16 265 1.2 matt 266 1.2 matt #define PCI_PBFR 0x44 /* Bus Function Register */ 267 1.2 matt #define PBFR_PAH __BIT(0) 268 1.2 matt 269 1.2 matt #endif /* PCI_PRIVATE */ 270 1.2 matt 271 1.2 matt #define OPENPIC_BASE 0x40000 272 1.2 matt #define OPENPIC_SIZE 0x40000 273 1.2 matt 274 1.2 matt #define L2CACHE_BASE 0x20000 275 1.2 matt #define L2CACHE_SIZE 0x01000 276 1.2 matt 277 1.2 matt #ifdef L2CACHE_PRIVATE 278 1.2 matt #define L2CTL 0x000 279 1.2 matt #define L2CTL_L2E __PPCBIT(0) 280 1.2 matt #define L2CTL_L2I __PPCBIT(1) 281 1.2 matt #define L2CTL_L2SIZ __PPCBITS(2,3) 282 1.2 matt #define L2CTL_L2SIZ_GET(x) (1 << (17 + __SHIFTOUT((x), L2CTL_L2SIZ))) 283 1.2 matt #define L2CTL_L2DO __PPCBIT(9) 284 1.2 matt #define L2CTL_L2IO __PPCBIT(10) 285 1.2 matt #define L2CTL_L2INTDIS __PPCBIT(12) 286 1.2 matt #define L2CTL_L2SRAM __PPCBITS(13,15) 287 1.2 matt #define L2CTL_L2LO __PPCBIT(18) 288 1.2 matt #define L2CTL_L2SLC __PPCBIT(19) 289 1.2 matt #define L2CTL_L2LFR __PPCBIT(21) 290 1.2 matt #define L2CTL_L2LFRID __PPCBITS(22,23) 291 1.2 matt #define L2CTL_L2STASHDIS __PPCBIT(28) 292 1.2 matt #define L2CTL_L2STASH __PPCBITS(30,31) 293 1.2 matt 294 1.2 matt #endif /* L2CACHE_PRIVATE */ 295 1.2 matt 296 1.2 matt #define I2C1_BASE 0x3000 297 1.2 matt #define I2C2_BASE 0x3100 298 1.2 matt #define I2C_SIZE 0x0100 299 1.2 matt 300 1.2 matt #ifdef I2C_PRIVATE 301 1.2 matt #define I2CADR 0x000 /* i2c address register */ 302 1.2 matt #define I2CFDR 0x004 /* i2c frequency divider register */ 303 1.2 matt #define I2CCR 0x008 /* i2c control register */ 304 1.2 matt #define I2CSR 0x00c /* i2c status register */ 305 1.2 matt #define I2CDR 0x010 /* i2c data register */ 306 1.2 matt #define I2CDFSSR 0x014 /* i2c address register */ 307 1.2 matt #endif /* I2C_PRIVATE */ 308 1.2 matt 309 1.2 matt #define DUART1_BASE 0x4500 310 1.2 matt #define DUART2_BASE 0x4600 311 1.2 matt #define DUART_SIZE 0x0100 312 1.2 matt 313 1.2 matt #define SPI_BASE 0x7000 /* MPC8536 */ 314 1.2 matt #define SPI_SIZE 0x1000 315 1.2 matt 316 1.16 nonaka #ifdef SPI_PRIVATE 317 1.16 nonaka #define SPMODE 0x000 /* mode register */ 318 1.16 nonaka #define SPMODE_EN __PPCBIT(0) /* Enable eSPI: 0=disabled, 1=enabled */ 319 1.16 nonaka #define SPMODE_LOOP __PPCBIT(1) /* Loop mode: 0=normal, 1=loopback */ 320 1.16 nonaka #define SPMODE_OD __PPCBIT(2) /* P1023: Open drain mode: 0=actively driven, 1=open drain */ 321 1.16 nonaka #define SPMODE_HO_ADJ __PPCBITS(13,15) /* Data output hold adjustment */ 322 1.16 nonaka #define SPMODE_TXTHR __PPCBITS(18,23) /* Tx FIFO Threshold: 1-32 */ 323 1.16 nonaka #define SPMODE_RXTHR __PPCBITS(27,31) /* Rx FIFO threshold: 0-31 */ 324 1.16 nonaka #define SPIE 0x004 /* event register */ 325 1.16 nonaka #define SPIE_RXCNT __PPCBITS(2,7) /* current number of full Rx FIFO bytes */ 326 1.16 nonaka #define SPIE_TXCNT __PPCBITS(10,15) /* current number of full Tx FIFO bytes */ 327 1.16 nonaka #define SPIE_TXE __PPCBIT(16) /* Tx FIFO is empty */ 328 1.16 nonaka #define SPIE_DON __PPCBIT(17) /* Last character was transmitted */ 329 1.16 nonaka #define SPIE_RXT __PPCBIT(18) /* Rx FIFO has more than RXTHR bytes */ 330 1.16 nonaka #define SPIE_RXF __PPCBIT(19) /* Rx FIFO is full */ 331 1.16 nonaka #define SPIE_TXT __PPCBIT(20) /* Tx FIFO has less than TXTHR bytes */ 332 1.16 nonaka #define SPIE_RNE __PPCBIT(22) /* Not empty: 0=empty, 1=not empty */ 333 1.16 nonaka #define SPIE_TNF __PPCBIT(23) /* Tx FIFO not full: 0=full, 1=not full */ 334 1.16 nonaka #define SPIM 0x008 /* mask register */ 335 1.16 nonaka #define SPIM_TXE __PPCBIT(16) 336 1.16 nonaka #define SPIM_DON __PPCBIT(17) 337 1.16 nonaka #define SPIM_RXT __PPCBIT(18) 338 1.16 nonaka #define SPIM_RXF __PPCBIT(19) 339 1.16 nonaka #define SPIM_TXT __PPCBIT(20) 340 1.16 nonaka #define SPIM_RNE __PPCBIT(22) 341 1.16 nonaka #define SPIM_TNF __PPCBIT(23) 342 1.16 nonaka #define SPCOM 0x00c /* command register */ 343 1.16 nonaka #define SPCOM_CS __PPCBITS(0,1) /* Chip select: 0=CS0, 1=CS1, 2=CS2(P1025), 3=CS3(P1025) */ 344 1.16 nonaka #define SPCOM_RXDELAY __PPCBIT(2) /* 0=normal eSPI operation */ 345 1.16 nonaka #define SPCOM_DO __PPCBIT(3) /* 0=normal eSPI operation, 1=Winbond dual output read */ 346 1.16 nonaka #define SPCOM_TO __PPCBIT(4) /* Transmit only: 0=normal operation, 1=No reception is done for the frame */ 347 1.16 nonaka #define SPCOM_HLD __PPCBIT(5) /* 0=normal operation, 1=Mask first generated SPI_CLK */ 348 1.16 nonaka #define SPCOM_LS __PPCBIT(6) /* P1023: Late sample: 0=normal operation, 1=Late data sample */ 349 1.16 nonaka #define SPCOM_RXSKIP __PPCBITS(8,15) /* if RxSKIP != 0: Number of characters skipped for reception from frame start */ 350 1.16 nonaka #define SPCOM_TRANLEN __PPCBITS(16,31) /* Transaction length */ 351 1.16 nonaka #define SPITF 0x010 /* transmit FIFO access register */ 352 1.16 nonaka #define SPIRF 0x014 /* receive FIFO access register */ 353 1.16 nonaka #define SPMODE0 0x020 /* CS0 mode register */ 354 1.16 nonaka #define SPMODE1 0x024 /* CS1 mode register */ 355 1.16 nonaka #define SPMODE2 0x028 /* CS2 mode register (P1025) */ 356 1.16 nonaka #define SPMODE3 0x02c /* CS3 mode register (P1025) */ 357 1.16 nonaka #define SPMODEn(n) (0x020+(n)*4) 358 1.16 nonaka #define SPMODEn_CI __PPCBIT(0) /* Clock invert: 0=inactive state of SPI_CLK is low, 1=high */ 359 1.16 nonaka #define SPMODEn_CP __PPCBIT(1) /* Clock phase: SPI_CLK starts toggling at the middle of the data transfer, 1=beginning */ 360 1.16 nonaka #define SPMODEn_REV __PPCBIT(2) /* Reverse data mode: 0=LSB of the character sent and received first, 1=MSB */ 361 1.17 andvar #define SPMODEn_DIV16 __PPCBIT(3) /* Divide by 16: 0=System clock, 1=System clock/16 */ 362 1.16 nonaka #define SPMODEn_PM __PPCBITS(4,7) /* Prescale modulus select */ 363 1.16 nonaka #define SPMODEn_ODD __PPCBIT(8) /* 0=Even division, 1=Odd dividion */ 364 1.16 nonaka #define SPMODEn_POL __PPCBIT(11) /* CS polarity: 0=Asserted high/Negated low, 1=Asserted low/Negated high */ 365 1.16 nonaka #define SPMODEn_LEN __PPCBITS(12,15) /* Character length in bits per character */ 366 1.16 nonaka #define SPMODEn_CSBEF __PPCBITS(16,19) /* CS assertion time in bits before frame start */ 367 1.16 nonaka #define SPMODEn_CSAFT __PPCBITS(20,23) /* CS assertion time in bits after frame end */ 368 1.16 nonaka #define SPMODEn_CSCG __PPCBITS(24,28) /* Clock gap */ 369 1.16 nonaka #endif 370 1.16 nonaka 371 1.2 matt #define SATA1_BASE 0x18000 /* MPC8536 */ 372 1.2 matt #define SATA2_BASE 0x19000 /* MPC8536 */ 373 1.2 matt #define SATA_SIZE 0x01000 374 1.2 matt 375 1.2 matt #define USB1_BASE 0x22100 /* MPC8536 */ 376 1.2 matt #define USB2_BASE 0x23100 /* MPC8536 */ 377 1.2 matt #define USB3_BASE 0x2b100 /* MPC8536 */ 378 1.8 matt #define USB_SNOOP1 0x0300 /* DMA Snooping Register 1 */ 379 1.8 matt #define USB_SNOOP2 0x0304 /* DMA Snooping Register 2 */ 380 1.8 matt #define USB_CONTROL 0x0400 /* USB General Purpose Register */ 381 1.8 matt #define USB_EN __PPCBIT(29) 382 1.8 matt #define USB_ULPI_INT_EN __PPCBIT(31) 383 1.2 matt #define USB_SIZE 0x00f00 384 1.2 matt 385 1.4 matt #define SNOOP_2GB 0x1e 386 1.4 matt 387 1.2 matt #define ETSEC1_BASE 0x24000 388 1.2 matt #define ETSEC2_BASE 0x25000 389 1.2 matt #define ETSEC3_BASE 0x26000 390 1.2 matt #define ETSEC4_BASE 0x27000 391 1.12 matt #define ETSEC1_G0_BASE 0xB0000 392 1.12 matt #define ETSEC2_G0_BASE 0xB1000 393 1.12 matt #define ETSEC3_G0_BASE 0xB2000 394 1.12 matt #define ETSEC1_G1_BASE 0xB4000 395 1.12 matt #define ETSEC2_G1_BASE 0xB5000 396 1.12 matt #define ETSEC3_G1_BASE 0xB6000 397 1.2 matt #define ETSEC_SIZE 0x01000 398 1.2 matt 399 1.2 matt #define ESDHC_BASE 0x2e000 400 1.2 matt #define ESDHC_SIZE 0x01000 401 1.2 matt 402 1.14 matt #ifdef ESDHC_PRIVATE 403 1.14 matt 404 1.14 matt #define DCR 0x40c /* DMA Control Register */ 405 1.14 matt 406 1.14 matt #define DCR_SNOOP __PPCBIT(25) /* DMA transactions are snooped */ 407 1.14 matt #define DCR_RD_SAFE __PPCBIT(29) /* memory is read safe */ 408 1.14 matt #define DCR_RD_PFE __PPCBIT(30) /* memory is prefetch safe */ 409 1.14 matt #define DCR_RD_PF_SIZE __PPCBIT(31) /* prefetch size is 32-bytes */ 410 1.14 matt 411 1.14 matt #endif 412 1.14 matt 413 1.2 matt #define GLOBAL_BASE 0xe0000 414 1.2 matt #define GLOBAL_SIZE 0x01000 415 1.2 matt 416 1.2 matt #ifdef GLOBAL_PRIVATE 417 1.2 matt 418 1.2 matt /* Power-On Reset Configuration Values */ 419 1.2 matt #define PORPLLSR 0x000 /* POR PLL ratio status register */ 420 1.3 matt #define E500_RATIO2 __PPCBITS(2,7) 421 1.3 matt #define E500_RATIO2_GET(n) __SHIFTOUT(n, E500_RATIO2) 422 1.2 matt #define E500_RATIO __PPCBITS(10,15) 423 1.2 matt #define E500_RATIO_GET(n) __SHIFTOUT(n, E500_RATIO) 424 1.2 matt #define PCI1_CLK_SEL __PPCBIT(16) 425 1.2 matt #define PCI2_CLK_SEL __PPCBIT(17) 426 1.2 matt #define PLAT_RATIO __PPCBITS(26,30) 427 1.2 matt #define PLAT_RATIO_GET(n) __SHIFTOUT(n, PLAT_RATIO) 428 1.2 matt #define PORBMSR 0x004 /* POR boot mode status register */ 429 1.3 matt #define PORBMSR_BCFG __PPCBITS(0,1) 430 1.2 matt #define PORBMSR_HA __PPCBITS(13,15) 431 1.2 matt #define PORBMSR_HA_GET(n) __SHIFTOUT(m, PORBMSR_HA) 432 1.2 matt #define PORBMSR_HA_PEXSRIO_AGENT 0 /* PCI Express & SRIO agent mode */ 433 1.2 matt #define PORBMSR_HA_SRIO_AGENT 1 /* SRIO agent mode */ 434 1.2 matt #define PORBMSR_HA_PEX_AGENT 2 /* PCI Express agent mode */ 435 1.2 matt #define PORBMSR_HA_PEXPCI_AGENT2 3 /* PCI[-X] & PCI Express agent mode */ 436 1.2 matt #define PORBMSR_HA_PCISRIO_AGENT2 4 /* PCI[-X] & SRIO mode */ 437 1.2 matt #define PORBMSR_HA_SRIO_AGENT2 5 /* SRIO agent mode */ 438 1.2 matt #define PORBMSR_HA_PCI_AGENT2 6 /* PCI[-X] agent mode */ 439 1.2 matt #define PORBMSR_HA_HOST 7 /* Host mode */ 440 1.2 matt #define PORIMPSCR 0x008 /* POR I/O impedance status and control register */ 441 1.2 matt #define PORDEVSR 0x00C /* POR I/O device status register */ 442 1.2 matt #define PORDEVSR_ECW1 __PPCBIT(0) 443 1.2 matt #define PORDEVSR_ECW2 __PPCBIT(1) 444 1.2 matt #define PORDEVSR_SGMII1_DIS1 __PPCBIT(2) 445 1.2 matt #define PORDEVSR_SGMII1_DIS2 __PPCBIT(3) 446 1.2 matt #define PORDEVSR_SGMII1_DIS3 __PPCBIT(4) 447 1.2 matt #define PORDEVSR_SGMII1_DIS4 __PPCBIT(5) 448 1.2 matt #define PORDEVSR_ECP1 __PPCBITS(6,7) 449 1.2 matt #define PORDEVSR_PCI1 __PPCBIT(8) 450 1.2 matt #define PCI1_PCIX 0 451 1.2 matt #define PCI1_PCI1 1 452 1.15 nonaka #define PORDEVSR_IOSEL_P1023 __PPCBITS(9,10) 453 1.15 nonaka #define IOSEL_P1023_PCIE12_X1 0 454 1.15 nonaka #define IOSEL_P1023_PCIE123_X1 1 455 1.15 nonaka #define IOSEL_P1023_PCIE123_X1_SGMII2 2 456 1.15 nonaka #define IOSEL_P1023_PCIE12_X1_SGMII12 3 457 1.2 matt #define PORDEVSR_IOSEL __PPCBITS(9,12) 458 1.2 matt #define IOSEL_MPC8536_OFF 0x01 459 1.2 matt #define IOSEL_MPC8536_PCIE1_X4 0x02 460 1.2 matt #define IOSEL_MPC8536_PCIE1_X8 0x03 461 1.2 matt #define IOSEL_MPC8536_PCIE12_X4 0x05 462 1.2 matt #define IOSEL_MPC8536_PCIE1_X4_PCI23_X2 0x07 463 1.2 matt #define IOSEL_MPC8544_OFF 0x00 464 1.2 matt #define IOSEL_MPC8544_SGMII_ON 0x01 465 1.2 matt #define IOSEL_MPC8544_PCIE1_ON 0x02 466 1.2 matt #define IOSEL_MPC8544_PCIE1_SGMII_ON 0x03 467 1.2 matt #define IOSEL_MPC8544_PCIE12_ON 0x04 468 1.2 matt #define IOSEL_MPC8544_PCIE12_SGMII_ON 0x05 469 1.2 matt #define IOSEL_MPC8544_PCIE123_ON 0x06 470 1.2 matt #define IOSEL_MPC8544_PCIE123_SGMII_ON 0x07 471 1.2 matt #define IOSEL_MPC8548_SRIO2500_PCIE1_X4 3 472 1.2 matt #define IOSEL_MPC8548_SRIO1250_PCIE1_X4 4 473 1.2 matt #define IOSEL_MPC8548_SRIO3125 5 474 1.2 matt #define IOSEL_MPC8548_SRIO1250 6 475 1.2 matt #define IOSEL_MPC8548_PCIE1_X8 7 476 1.2 matt #define IOSEL_MPC8572_PCIE1_X4 2 477 1.2 matt #define IOSEL_MPC8572_PCIE12_X4 3 478 1.2 matt #define IOSEL_MPC8572_SRIO2500 6 479 1.2 matt #define IOSEL_MPC8572_PCIE1_X4_23_X2 7 480 1.2 matt #define IOSEL_MPC8572_SRIO2500_PCIE1_X4 11 481 1.2 matt #define IOSEL_MPC8572_SRIO1250_PCIE1_X4 12 482 1.2 matt #define IOSEL_MPC8572_SRIO3125 13 483 1.2 matt #define IOSEL_MPC8572_SRIO1250 14 484 1.2 matt #define IOSEL_MPC8572_PCIE1_X8 15 485 1.3 matt #define IOSEL_P20x0_PCIE1_X1 0 486 1.3 matt #define IOSEL_P20x0_PCIE12_X1_3_X2 2 487 1.3 matt #define IOSEL_P20x0_PCIE13_X2 4 488 1.3 matt #define IOSEL_P20x0_PCIE1_X4 6 489 1.5 matt #define IOSEL_P20x0_PCIE1_X1_SRIO2500_1X 13 490 1.3 matt #define IOSEL_P20x0_PCIE12_X1_SGMII23 14 491 1.3 matt #define IOSEL_P20x0_PCIE1_X2_SGMII23 15 492 1.13 matt #define IOSEL_P1025_PCIE1_X1 0 /* same at P20x10 */ 493 1.13 matt #define IOSEL_P1025_PCIE1_X4 6 /* same at P20x10 */ 494 1.13 matt #define IOSEL_P1025_PCIE12_X1_SGMII23 14 /* same at P20x10 */ 495 1.13 matt #define IOSEL_P1025_PCIE1_X2_SGMII23 15 /* same at P20x10 */ 496 1.2 matt #define PORDEVSR_PCI2_ARB __PPCBIT(13) 497 1.2 matt #define PORDEVSR_PCI1_ARB __PPCBIT(14) 498 1.2 matt #define PORDEVSR_PCI32 __PPCBIT(15) 499 1.2 matt #define PCI32_FALSE 0 500 1.2 matt #define PCI32_TRUE 1 501 1.2 matt #define PORDEVSR_PCI1_SPD __PPCBIT(16) 502 1.2 matt #define PORDEVSR_PCI2_SPD __PPCBIT(17) 503 1.2 matt #define PORDEVSR_SYS_SPD __PPCBIT(17) /* MPC8536 */ 504 1.2 matt #define PORDEVSR_CORE_SPD __PPCBIT(18) /* MPC8536 */ 505 1.2 matt #define PORDEVSR_ECP2 __PPCBITS(18,19) 506 1.2 matt #define PORDEVSR_ECP3 __PPCBITS(20,21) 507 1.2 matt #define PORDEVSR_ECP4 __PPCBITS(22,23) 508 1.2 matt #define PORDEVSR_FEC_DIS __PPCBIT(24) 509 1.2 matt #define PORDEVSR_RTPE __PPCBIT(25) 510 1.2 matt #define PORDEVSR_RIO_CTLS __PPCBIT(28) 511 1.2 matt #define PORDEVSR_DEV_ID __PPCBITs(29,31) 512 1.2 matt #define PORDBGMSR 0x010 /* POR debug mode status register */ 513 1.2 matt #define PORDEVSR2 0x014 /* POR I/O device status register 2 */ 514 1.2 matt #define GPPORCR 0x020 /* General-purpose POR configuration register */ 515 1.2 matt 516 1.2 matt /* Signal Multiplexing and GPIO Controls */ 517 1.2 matt #define GPIOCR 0x030 /* GPIO control register */ 518 1.2 matt #define GPIOCR_TX2 __PPCBIT(6) /* Enable TSEC2_TX[7:0] as GP output */ 519 1.2 matt #define GPIOCR_RX2 __PPCBIT(7) /* Enable TSEC2_RX[7:0] as GP input */ 520 1.2 matt #define GPIOCR_PCIOUT __PPCBIT(14) /* Enable PCI2_AD[15:8] as GP output */ 521 1.2 matt #define GPIOCR_PCIIN __PPCBIT(15) /* Enable PCI2_AD[7:0] as GP input */ 522 1.2 matt #define GPIOCR_GPOUT __PPCBIT(22) /* Enable GPOUT[24:31] as GP output */ 523 1.2 matt #define GPOUTDR 0x040 /* General-purpose output data register */ 524 1.2 matt #define GPOUTDR_TX2 0x040 /* General-purpose output data register */ 525 1.2 matt #define GPOUTDR_PCI 0x041 /* General-purpose output data register */ 526 1.2 matt #define GPOUTDR_GPOUT 0x043 /* General-purpose output data register */ 527 1.2 matt #define GPINDR 0x050 /* General-purpose input data register */ 528 1.2 matt #define GPINDR_RX2 0x059 529 1.2 matt #define GPINDR_PCI 0x051 530 1.2 matt 531 1.2 matt #define PMUXCR 0x060 /* Alternate function signal multiplex control */ 532 1.2 matt #define PMUXCR_SD_DATA __PPCBIT(0) 533 1.2 matt #define PMUXCR_SDHC_CD __PPCBIT(1) 534 1.2 matt #define PMUXCR_SDHC_WP __PPCBIT(2) 535 1.2 matt #define PMUXCR_PCI_REQGNT3 __PPCBIT(3) 536 1.5 matt #define PMUXCR_TSEC1_TS __PPCBIT(3) 537 1.2 matt #define PMUXCR_PCI_REQGNT4 __PPCBIT(4) 538 1.5 matt #define PMUXCR_TSEC2_TS __PPCBIT(4) 539 1.2 matt #define PMUXCR_USB1 __PPCBIT(5) 540 1.5 matt #define PMUXCR_TSEC3_TS __PPCBIT(5) 541 1.2 matt #define PMUXCR_USB2 __PPCBIT(6) 542 1.11 matt #define PMUXCR_USB_PCTL __PPCBITS(6,5) 543 1.11 matt #define PMUXCR_USB __PPCBIT(6) 544 1.11 matt #define PMUXCR_TSEC1 __PPCBIT(14) 545 1.2 matt #define PMUXCR_DMA0 __PPCBIT(14) 546 1.2 matt #define PMUXCR_DMA2 __PPCBIT(15) 547 1.11 matt #define PMUXCR_QE0 __PPCBIT(16) 548 1.11 matt #define PMUXCR_QE1 __PPCBIT(17) 549 1.11 matt #define PMUXCR_QE2 __PPCBIT(18) 550 1.11 matt #define PMUXCR_QE3 __PPCBIT(19) 551 1.11 matt #define PMUXCR_QE8 __PPCBIT(24) 552 1.11 matt #define PMUXCR_QE9 __PPCBIT(25) 553 1.11 matt #define PMUXCR_QE10 __PPCBIT(26) 554 1.11 matt #define PMUXCR_QE11 __PPCBIT(27) 555 1.11 matt #define PMUXCR_QE12 __PPCBIT(28) 556 1.2 matt #define PMUXCR_DMA1 __PPCBIT(30) 557 1.2 matt #define PMUXCR_DMA3 __PPCBIT(31) 558 1.2 matt 559 1.15 nonaka #define PMUXCR2 0x064 /* Alternate function signal multiplex control2 */ 560 1.15 nonaka 561 1.2 matt /* Device Disables */ 562 1.2 matt #define DEVDISR 0x070 /* Device disable control */ 563 1.2 matt #define DEVDISR_PCI1 __PPCBIT(0) 564 1.15 nonaka #define DEVDISR_QMAN_BMAN __PPCBIT(0) /* P1023 */ 565 1.2 matt #define DEVDISR_PCI2 __PPCBIT(1) 566 1.15 nonaka #define DEVDISR_FMAN __PPCBIT(1) /* P1023 */ 567 1.2 matt #define DEVDISR_PCIE __PPCBIT(2) 568 1.15 nonaka #define DEVDISR_MACSEC __PPCBIT(3) /* P1023 */ 569 1.2 matt #define DEVDISR_LBC __PPCBIT(4) 570 1.2 matt #define DEVDISR_PCIE2 __PPCBIT(5) 571 1.2 matt #define DEVDISR_PCIE3 __PPCBIT(6) 572 1.2 matt #define DEVDISR_SEC __PPCBIT(7) 573 1.2 matt #define DEVDISR_PME __PPCBIT(8) 574 1.2 matt #define DEVDISR_USB1 __PPCBIT(8) /* MPC8536 */ 575 1.2 matt #define DEVDISR_TLU1 __PPCBIT(9) 576 1.2 matt #define DEVDISR_USB2 __PPCBIT(9) /* MPC8536 */ 577 1.2 matt #define DEVDISR_TLU2 __PPCBIT(10) 578 1.3 matt #define DEVDISR_ESDHC_10 __PPCBIT(10) 579 1.2 matt #define DEVDISR_USB3 __PPCBIT(10) /* MPC8536 */ 580 1.2 matt #define DEVDISR_L2 __PPCBIT(11) /* MPC8536 */ 581 1.2 matt #define DEVDISR_SRIO __PPCBIT(12) 582 1.3 matt #define DEVDISR_ESDHC_12 __PPCBIT(12) /* MPC8536 */ 583 1.2 matt #define DEVDISR_RMSG __PPCBIT(13) 584 1.2 matt #define DEVDISR_SATA1 __PPCBIT(13) /* MPC8536 */ 585 1.3 matt #define DEVDISR_DDR2_14 __PPCBIT(14) 586 1.3 matt #define DEVDISR_DDR_15 __PPCBIT(15) 587 1.3 matt #define DEVDISR_SPI_15 __PPCBIT(15) /* MPC8536 */ 588 1.2 matt #define DEVDISR_E500 __PPCBIT(16) 589 1.3 matt #define DEVDISR_DDR_16 __PPCBIT(16) /* MPC8536 */ 590 1.2 matt #define DEVDISR_TB __PPCBIT(17) 591 1.2 matt #define DEVDISR_E500_1 __PPCBIT(18) 592 1.2 matt #define DEVDISR_TB_1 __PPCBIT(19) 593 1.2 matt #define DEVDISR_SATA2 __PPCBIT(20) /* MPC8536 */ 594 1.2 matt #define DEVDISR_DMA __PPCBIT(21) 595 1.2 matt #define DEVDISR_DMA2 __PPCBIT(22) 596 1.2 matt #define DEVDISR_SRDS2 __PPCBIT(22) /* MPC8536 */ 597 1.2 matt #define DEVDISR_TSEC1 __PPCBIT(24) 598 1.2 matt #define DEVDISR_TSEC2 __PPCBIT(25) 599 1.2 matt #define DEVDISR_TSEC3 __PPCBIT(26) 600 1.2 matt #define DEVDISR_TSEC4 __PPCBIT(27) 601 1.2 matt #define DEVDISR_FEC __PPCBIT(28) 602 1.3 matt #define DEVDISR_SPI_28 __PPCBIT(28) /* P2020 */ 603 1.2 matt #define DEVDISR_I2C __PPCBIT(29) 604 1.2 matt #define DEVDISR_DUART __PPCBIT(30) 605 1.2 matt #define DEVDISR_SRDS1 __PPCBIT(31) /* MPC8536 */ 606 1.2 matt 607 1.2 matt /* Power Management Registers */ 608 1.2 matt #define POWMGTCSR 0x080 /* Power management status and control register */ 609 1.2 matt 610 1.2 matt /* Interrupt and Reset Status and Control */ 611 1.2 matt #define MCPSUMR 0x090 /* Machine check summary register */ 612 1.2 matt #define RSTRSCR 0x094 /* Reset request status and control register */ 613 1.2 matt 614 1.2 matt /* Version Registers */ 615 1.2 matt #define PVR 0x0A0 /* Processor version register */ 616 1.2 matt #define SVR 0x0A4 /* System version register */ 617 1.2 matt 618 1.11 matt /* Control Pin Registers (GPIO) for P1025 */ 619 1.11 matt #define CPBASE(n) (0x100+0x20*(n)) /* Control Pin (GPIO) base */ 620 1.11 matt #define CPODR 0x0000 /* Open Drain */ 621 1.11 matt #define CPDAT 0x0004 /* Output Data */ 622 1.11 matt #define CPDIR1 0x0008 /* Direction1 */ 623 1.11 matt #define CPDIR2 0x000c /* Direction2 */ 624 1.11 matt #define CPPAR1 0x0010 /* Pin Assignment1 */ 625 1.11 matt #define CPPAR2 0x0014 /* Pin Assignment2 */ 626 1.11 matt 627 1.11 matt #define CPDIR_DIS 0 628 1.11 matt #define CPDIR_OUT 1 629 1.11 matt #define CPDIR_IN 2 630 1.11 matt #define CPDIR_INOUT 3 631 1.11 matt 632 1.11 matt #define CPPAR_FUNC0 0 633 1.11 matt #define CPPAR_FUNC1 1 634 1.11 matt #define CPPAR_FUNC2 2 635 1.11 matt #define CPPAR_FUNC3 3 636 1.11 matt 637 1.2 matt /* Status Registers */ 638 1.2 matt #define RSTCR 0x0B0 /* Reset control register */ 639 1.2 matt #define HRESET_REQ __PPCBIT(30) /* hardware reset request */ 640 1.2 matt #define LBCVSELCR 0x0C0 /* LBC voltage select control register */ 641 1.2 matt #define DDRCSR 0xB20 /* DDR calibration status register */ 642 1.2 matt #define DDRCDR 0xB24 /* DDR control driver register */ 643 1.2 matt #define DDRCLKDR 0xB28 /* DDR clock disable register */ 644 1.2 matt 645 1.2 matt /* Debug Control */ 646 1.2 matt #define CLKOCR 0xE00 /* Clock out control register */ 647 1.2 matt #define SRDSCR0 0xF04 /* LSerDes control register 0 */ 648 1.2 matt #define SRDSCR1 0xF08 /* LSerDes control register 1 */ 649 1.2 matt #define TSEC12IOOVCR 0xF28 /* eTSEC 1 & 2 overdrive control register */ 650 1.2 matt #define TSEC34IOOVCR 0xF2C /* eTSEC 3 & 4 overdrive control register */ 651 1.2 matt #endif /* GLOBAL_PRIVATE */ 652 1.2 matt 653 1.2 matt #define LBC_BASE 0x5000 654 1.2 matt #define LBC_SIZE 0x0fff 655 1.2 matt 656 1.2 matt #ifdef LBC_PRIVATE 657 1.2 matt 658 1.2 matt #define BR_BA __PPCBITS(0,16) 659 1.2 matt #define BR_XBA __PPCBITS(17,18) 660 1.2 matt #define BR_PS __PPCBITS(19,20) 661 1.2 matt #define BR_PS_8BIT __SHIFTIN(1,BR_PS) 662 1.2 matt #define BR_PS_16BIT __SHIFTIN(2,BR_PS) 663 1.2 matt #define BR_PS_32BIT __SHIFTIN(3,BR_PS) 664 1.2 matt #define BR_DECC __PPCBITS(21,22) 665 1.2 matt #define BR_DECC_NONE __SHIFTIN(0,BR_DECC) 666 1.2 matt #define BR_DECC_PARITY __SHIFTIN(1,BR_DECC) 667 1.2 matt #define BR_DECC_RMWPAR __SHIFTIN(2,BR_DECC) 668 1.2 matt #define BR_WP __PPCBIT(23) 669 1.2 matt #define BR_MSEL __PPCBITS(24,26) 670 1.2 matt #define BR_MSEL_GPCM __SHIFTIN(0,BR_MSEL) 671 1.2 matt #define BR_MSEL_FCM __SHIFTIN(1,BR_MSEL) 672 1.2 matt #define BR_MSEL_SDRAM __SHIFTIN(3,BR_MSEL) 673 1.2 matt #define BR_MSEL_UPMA __SHIFTIN(4,BR_MSEL) 674 1.2 matt #define BR_MSEL_UPMB __SHIFTIN(5,BR_MSEL) 675 1.2 matt #define BR_MSEL_UPMC __SHIFTIN(6,BR_MSEL) 676 1.2 matt #define BR_ATOM __PPCBITS(28,29) 677 1.2 matt #define BR_ATOM_NONE __SHIFTIN(0,BR_ATOM) 678 1.2 matt #define BR_ATOM_RAWA __SHIFTIN(1,BR_ATOM) 679 1.2 matt #define BR_ATOM_WARA __SHIFTIN(2,BR_ATOM) 680 1.2 matt #define BR_V __PPCBIT(31) 681 1.2 matt 682 1.2 matt #define OR_AM __PPCBITS(0,16) 683 1.2 matt #define OR_XAM __PPCBITS(17,18) 684 1.2 matt #define OR_BCTLD __PPCBIT(19) 685 1.2 matt #define OR_CSNT __PPCBIT(20) 686 1.2 matt #define OR_ACS __PPCBITS(21,22) 687 1.2 matt #define OR_XACS __PPCBIT(23) 688 1.2 matt #define OR_SCY __PPCBITS(24,27) 689 1.2 matt #define OR_SETA __PPCBIT(28) 690 1.2 matt #define OR_TRLX __PPCBIT(29) 691 1.2 matt #define OR_EHTR __PPCBIT(30) 692 1.2 matt #define OR_EAD __PPCBIT(31) 693 1.2 matt 694 1.2 matt #define BRn(n) (BR0 + 8*(n)) 695 1.2 matt #define ORn(n) (OR0 + 8*(n)) 696 1.2 matt #define BR0 0x000 /* Base register 0 */ 697 1.2 matt #define OR0 0x004 /* Options register 0 */ 698 1.2 matt #define BR1 0x008 /* Base register 1 */ 699 1.2 matt #define OR1 0x00C /* Options register 1 */ 700 1.2 matt #define BR2 0x010 /* Base register 2 */ 701 1.2 matt #define OR2 0x014 /* Options register 2 */ 702 1.2 matt #define BR3 0x018 /* Base register 3 */ 703 1.2 matt #define OR3 0x01C /* Options register 3 */ 704 1.2 matt #define BR4 0x020 /* Base register 4 */ 705 1.2 matt #define OR4 0x024 /* Options register 4 */ 706 1.2 matt #define BR5 0x028 /* Base register 5 */ 707 1.2 matt #define OR5 0x02C /* Options register 5 */ 708 1.2 matt #define BR6 0x030 /* Base register 6 */ 709 1.2 matt #define OR6 0x034 /* Options register 6 */ 710 1.2 matt #define BR7 0x038 /* Base register 7 */ 711 1.2 matt #define OR7 0x03C /* Options register 7 */ 712 1.2 matt #define MAR 0x068 /* UPM address register */ 713 1.2 matt #define MAMR 0x070 /* UPMA mode register */ 714 1.2 matt #define MBMR 0x074 /* UPMB mode register */ 715 1.2 matt #define MCMR 0x078 /* UPMC mode register */ 716 1.2 matt #define MRTPR 0x084 /* Memory refresh timer prescaler register */ 717 1.6 matt #define MDR 0x088 /* UPM/FCM data register */ 718 1.6 matt #define MDR_AS3 __PPCBITS(0,7) 719 1.6 matt #define MDR_AS2 __PPCBITS(8,15) 720 1.6 matt #define MDR_AS1 __PPCBITS(16,23) 721 1.6 matt #define MDR_AS0 __PPCBITS(24,31) 722 1.9 matt #define LSOR 0x090 /* Special Operation Initiation register */ 723 1.2 matt #define LSDMR 0x094 /* SDRAM mode register */ 724 1.2 matt #define LURT 0x0A0 /* UPM refresh timer */ 725 1.2 matt #define LSRT 0x0A4 /* SDRAM refresh timer */ 726 1.2 matt #define LTESR 0x0B0 /* Transfer error status register */ 727 1.6 matt #define LTESR_BM __PPCBIT(0) 728 1.6 matt #define LTESR_FCT __PPCBIT(1) 729 1.6 matt #define LTESR_PAR __PPCBIT(2) 730 1.6 matt #define LTESR_WP __PPCBIT(5) 731 1.6 matt #define LTESR_ATMW __PPCBIT(8) 732 1.6 matt #define LTESR_ATMR __PPCBIT(9) 733 1.6 matt #define LTESR_CS __PPCBIT(12) 734 1.6 matt #define LTESR_UCC __PPCBIT(30) 735 1.6 matt #define LTESR_CC __PPCBIT(31) 736 1.2 matt #define LTEDR 0x0B4 /* Transfer error disable register */ 737 1.6 matt #define LTEDR_BMD __PPCBIT(0) 738 1.6 matt #define LTEDR_FCTD __PPCBIT(1) 739 1.6 matt #define LTEDR_PARD __PPCBIT(2) 740 1.6 matt #define LTEDR_WPD __PPCBIT(5) 741 1.6 matt #define LTEDR_WARA __PPCBIT(8) 742 1.6 matt #define LTEDR_RAWA __PPCBIT(9) 743 1.6 matt #define LTEDR_CSD __PPCBIT(12) 744 1.6 matt #define LTEDR_UCCD __PPCBIT(30) 745 1.6 matt #define LTEDR_CCD __PPCBIT(31) 746 1.2 matt #define LTEIR 0x0B8 /* Transfer error interrupt register */ 747 1.6 matt #define LTEIR_BMI __PPCBIT(0) 748 1.6 matt #define LTEIR_FCTI __PPCBIT(1) 749 1.6 matt #define LTEIR_PARI __PPCBIT(2) 750 1.6 matt #define LTEIR_WPI __PPCBIT(5) 751 1.6 matt #define LTEIR_WARA __PPCBIT(8) 752 1.6 matt #define LTEIR_RAWA __PPCBIT(9) 753 1.6 matt #define LTEIR_CSI __PPCBIT(12) 754 1.6 matt #define LTEIR_UCCI __PPCBIT(30) 755 1.6 matt #define LTEIR_CCI __PPCBIT(31) 756 1.2 matt #define LTEATR 0x0BC /* Transfer error attributes register */ 757 1.6 matt #define LTEATR_RWB __PPCBIT(3) 758 1.6 matt #define LTEATR_SRCID __PPCBITS(11,15) 759 1.6 matt #define LTEATR_PB __PPCBITS(16,19) 760 1.6 matt #define LTEATR_BNK __PPCBITS(20,27) 761 1.6 matt #define LTEATR_V __PPCBIT(31) 762 1.2 matt #define LTEAR 0x0C0 /* Transfer error address register */ 763 1.6 matt #define LTECCR 0x0C4 /* Transfer error ECC register */ 764 1.6 matt #define LTECCR_SBCE __PPCBITS(12,15) 765 1.6 matt #define LTECCR_MBUE __PPCBITS(28,31) 766 1.2 matt #define LBCR 0x0D0 /* Configuration register */ 767 1.2 matt #define LCRR 0x0D4 /* Clock ratio register */ 768 1.2 matt 769 1.6 matt #define FMR 0x0E0 /* Flash Mode Register */ 770 1.6 matt #define FMR_CWTO __PPCBITS(16,19) 771 1.6 matt #define FMR_BOOT __PPCBIT(20) 772 1.6 matt #define FMR_ECCM __PPCBIT(23) 773 1.6 matt #define FMR_AL __PPCBITS(26,27) 774 1.6 matt #define FMR_OP __PPCBITS(30,31) 775 1.6 matt #define FIR 0x0E4 /* Flash Instruction Register */ 776 1.6 matt #define FIR_OP0 __PPCBITS(0,3) 777 1.6 matt #define FIR_OP1 __PPCBITS(4,7) 778 1.6 matt #define FIR_OP2 __PPCBITS(8,11) 779 1.6 matt #define FIR_OP3 __PPCBITS(12,15) 780 1.6 matt #define FIR_OP4 __PPCBITS(16,19) 781 1.6 matt #define FIR_OP5 __PPCBITS(20,23) 782 1.6 matt #define FIR_OP6 __PPCBITS(24,27) 783 1.6 matt #define FIR_OP7 __PPCBITS(28,31) 784 1.6 matt #define FIR_OP_NOP 0 785 1.6 matt #define FIR_OP_CA 1 /* Issue current column address */ 786 1.6 matt #define FIR_OP_PA 2 /* Issue current block+page address */ 787 1.6 matt #define FIR_OP_UA 3 /* Issue user-defined address byte */ 788 1.6 matt #define FIR_OP_CM0 4 /* Issue command from FCR[CMD0] */ 789 1.6 matt #define FIR_OP_CM1 5 /* Issue command from FCR[CMD1] */ 790 1.6 matt #define FIR_OP_CM2 6 /* Issue command from FCR[CMD2] */ 791 1.6 matt #define FIR_OP_CM3 7 /* Issue command from FCR[CMD3] */ 792 1.6 matt #define FIR_OP_WB 8 /* Write FBCR bytes of data */ 793 1.6 matt #define FIR_OP_WS 9 /* Write one byte of data from MDR */ 794 1.6 matt #define FIR_OP_RB 10 /* Read FBCR bytes of data */ 795 1.6 matt #define FIR_OP_RS 11 /* Read one byte of data into MDR */ 796 1.6 matt #define FIR_OP_CW0 12 /* Wait for LFRB then FCR[CMD0] */ 797 1.6 matt #define FIR_OP_CW1 13 /* Wait for LFRB then FCR[CMD1] */ 798 1.6 matt #define FIR_OP_RBW 14 /* Wait for LFRB then read FBCR bytes */ 799 1.6 matt #define FIR_OP_RSW 15 /* Wait for LFRB then byte into MDR */ 800 1.6 matt #define FCR 0xE8 /* Flash Command Register */ 801 1.6 matt #define FCR_CMD0 __PPCBITS(0,7) 802 1.6 matt #define FCR_CMD1 __PPCBITS(8,15) 803 1.6 matt #define FCR_CMD2 __PPCBITS(16,23) 804 1.6 matt #define FCR_CMD3 __PPCBITS(24,31) 805 1.6 matt #define FBAR 0xEC /* Flash Block Address Register */ 806 1.6 matt #define FBAR_BLK __PPCBITS(8,31) 807 1.6 matt #define FPAR 0xF0 /* Flash Page Address Register */ 808 1.6 matt #define FPAR_S_PI __PPCBITS(17,21) /* Page Index */ 809 1.6 matt #define FPAR_S_MS __PPCBIT(22) /* Main(0)/Spare(1) */ 810 1.6 matt #define FPAR_S_CI __PPCBITS(23,31) /* Column Index */ 811 1.6 matt #define FPAR_L_PI __PPCBITS(14,19) /* Page Index */ 812 1.6 matt #define FPAR_L_MS __PPCBIT(20) /* Main(0)/Spare(1) */ 813 1.6 matt #define FPAR_L_CI __PPCBITS(21,31) /* Column Index */ 814 1.6 matt #define FBCR 0xF4 /* Flash Byte Count Register */ 815 1.6 matt #define FBCR_BC __PPCBITS(20,31) 816 1.6 matt #define FECC0 0x100 817 1.6 matt #define FECC_V __PPCBIT(0) 818 1.6 matt #define FECC_ECC __PPCBIT(8,31) 819 1.6 matt #define FECC1 0x104 820 1.6 matt #define FECC2 0x108 821 1.6 matt #define FECC3 0x10C 822 1.6 matt 823 1.2 matt #define MXMR_RFEN __PPCBIT(1) /* Refresh enable */ 824 1.2 matt #define MXMR_OP __PPCBITS(2,3) /* Command opcode */ 825 1.2 matt #define MXMR_OP_NORMAL __SHIFTIN(0, MXMR_OP) /* Normal Operation */ 826 1.2 matt #define MXMR_OP_WRITE __SHIFTIN(1, MXMR_OP) /* Write to UPM memory */ 827 1.2 matt #define MXMR_OP_READ __SHIFTIN(2, MXMR_OP) /* Read from UPM memory */ 828 1.2 matt #define MXMR_OP_RUN __SHIFTIN(3, MXMR_OP) /* Run Pattern */ 829 1.2 matt #define MXMR_UWPL __PPCBIT(3) /* LUPWAIT is active low */ 830 1.2 matt #define MXMR_AM __PPCBITS(5,7) /* Address multiplex size */ 831 1.2 matt #define MXMR_DS __PPCBITS(8,9) /* Disable timer period */ 832 1.2 matt #define MXMR_DS_1CYCLE __SHIFTIN(0,MXMR_DS) 833 1.2 matt #define MXMR_DS_2CYCLE __SHIFTIN(1,MXMR_DS) 834 1.2 matt #define MXMR_DS_3CYCLE __SHIFTIN(2,MXMR_DS) 835 1.2 matt #define MXMR_DS_4CYCLE __SHIFTIN(3,MXMR_DS) 836 1.2 matt #define MXMR_G0CL __PPCBITS(10,12) /* General line 0 control */ 837 1.2 matt #define MXMR_G0CL_A12 __SHIFTIN(0,MXMR_G0CL) 838 1.2 matt #define MXMR_G0CL_A11 __SHIFTIN(1,MXMR_G0CL) 839 1.2 matt #define MXMR_G0CL_A10 __SHIFTIN(2,MXMR_G0CL) 840 1.2 matt #define MXMR_G0CL_A9 __SHIFTIN(3,MXMR_G0CL) 841 1.2 matt #define MXMR_G0CL_A8 __SHIFTIN(4,MXMR_G0CL) 842 1.2 matt #define MXMR_G0CL_A7 __SHIFTIN(5,MXMR_G0CL) 843 1.2 matt #define MXMR_G0CL_A6 __SHIFTIN(6,MXMR_G0CL) 844 1.2 matt #define MXMR_G0CL_A5 __SHIFTIN(7,MXMR_G0CL) 845 1.2 matt #define MXMR_GPL4 __PPCBIT(13) /* LGPL4 output line disable */ 846 1.2 matt #define MXMR_RLF __PPCBITS(14,17) /* Read loop field */ 847 1.2 matt #define MXMR_WLF __PPCBITS(18,21) /* Write loop field */ 848 1.2 matt #define MXMR_TLF __PPCBITS(22,25) /* Refresh loop field */ 849 1.2 matt #define MXMR_MAS __PPCBITS(26,31) /* Machine Address */ 850 1.2 matt 851 1.2 matt #define MRTPR_PTP __PPCBITS(0,7) /* Refresh timers prescaler */ 852 1.2 matt 853 1.2 matt #endif /* LBC_PRIVATE */ 854