0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef _ASM_SN_SN0_ADDRS_H
0012 #define _ASM_SN_SN0_ADDRS_H
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051 #ifdef CONFIG_SGI_SN_N_MODE
0052
0053 #define NODE_SIZE_BITS 31
0054 #define BWIN_SIZE_BITS 28
0055
0056 #define NASID_BITS 9
0057 #define NASID_BITMASK (0x1ffLL)
0058 #define NASID_SHFT 31
0059 #define NASID_META_BITS 5
0060 #define NASID_LOCAL_BITS 4
0061
0062 #define BDDIR_UPPER_MASK (UINT64_CAST 0x7ffff << 10)
0063 #define BDECC_UPPER_MASK (UINT64_CAST 0x3ffffff << 3)
0064
0065 #else
0066
0067 #define NODE_SIZE_BITS 32
0068 #define BWIN_SIZE_BITS 29
0069
0070 #define NASID_BITMASK (0xffLL)
0071 #define NASID_BITS 8
0072 #define NASID_SHFT 32
0073 #define NASID_META_BITS 4
0074 #define NASID_LOCAL_BITS 4
0075
0076 #define BDDIR_UPPER_MASK (UINT64_CAST 0xfffff << 10)
0077 #define BDECC_UPPER_MASK (UINT64_CAST 0x7ffffff << 3)
0078
0079 #endif
0080
0081 #define NODE_ADDRSPACE_SIZE (UINT64_CAST 1 << NODE_SIZE_BITS)
0082
0083 #define NASID_MASK (UINT64_CAST NASID_BITMASK << NASID_SHFT)
0084 #define NASID_GET(_pa) (int) ((UINT64_CAST (_pa) >> \
0085 NASID_SHFT) & NASID_BITMASK)
0086
0087 #if !defined(__ASSEMBLY__)
0088
0089 #define NODE_SWIN_BASE(nasid, widget) \
0090 ((widget == 0) ? NODE_BWIN_BASE((nasid), SWIN0_BIGWIN) \
0091 : RAW_NODE_SWIN_BASE(nasid, widget))
0092 #else
0093 #define NODE_SWIN_BASE(nasid, widget) \
0094 (NODE_IO_BASE(nasid) + (UINT64_CAST(widget) << SWIN_SIZE_BITS))
0095 #endif
0096
0097
0098
0099
0100
0101
0102
0103 #define BWIN_INDEX_BITS 3
0104 #define BWIN_SIZE (UINT64_CAST 1 << BWIN_SIZE_BITS)
0105 #define BWIN_SIZEMASK (BWIN_SIZE - 1)
0106 #define BWIN_WIDGET_MASK 0x7
0107 #define NODE_BWIN_BASE0(nasid) (NODE_IO_BASE(nasid) + BWIN_SIZE)
0108 #define NODE_BWIN_BASE(nasid, bigwin) (NODE_BWIN_BASE0(nasid) + \
0109 (UINT64_CAST(bigwin) << BWIN_SIZE_BITS))
0110
0111 #define BWIN_WIDGETADDR(addr) ((addr) & BWIN_SIZEMASK)
0112 #define BWIN_WINDOWNUM(addr) (((addr) >> BWIN_SIZE_BITS) & BWIN_WIDGET_MASK)
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123 #define NODE_BWIN_ADDR(nasid, addr) \
0124 (((addr) >= NODE_BWIN_BASE0(nasid)) && \
0125 ((addr) < (NODE_BWIN_BASE(nasid, HUB_NUM_BIG_WINDOW) + \
0126 BWIN_SIZE)))
0127
0128
0129
0130
0131
0132
0133
0134
0135 #define CALIAS_BASE CAC_BASE
0136
0137 #define SN0_WIDGET_BASE(_nasid, _wid) (NODE_SWIN_BASE((_nasid), (_wid)))
0138
0139
0140 #define SABLE_LOG_TRIGGER(_map)
0141
0142 #ifndef __ASSEMBLY__
0143 #define KERN_NMI_ADDR(nasid, slice) \
0144 TO_NODE_UNCAC((nasid), IP27_NMI_KREGS_OFFSET + \
0145 (IP27_NMI_KREGS_CPU_SIZE * (slice)))
0146 #endif
0147
0148 #ifdef PROM
0149
0150 #define MISC_PROM_BASE PHYS_TO_K0(0x01300000)
0151 #define MISC_PROM_SIZE 0x200000
0152
0153 #define DIAG_BASE PHYS_TO_K0(0x01500000)
0154 #define DIAG_SIZE 0x300000
0155
0156 #define ROUTE_BASE PHYS_TO_K0(0x01800000)
0157 #define ROUTE_SIZE 0x200000
0158
0159 #define IP27PROM_FLASH_HDR PHYS_TO_K0(0x01300000)
0160 #define IP27PROM_FLASH_DATA PHYS_TO_K0(0x01301000)
0161 #define IP27PROM_CORP_MAX 32
0162 #define IP27PROM_CORP PHYS_TO_K0(0x01800000)
0163 #define IP27PROM_CORP_SIZE 0x10000
0164 #define IP27PROM_CORP_STK PHYS_TO_K0(0x01810000)
0165 #define IP27PROM_CORP_STKSIZE 0x2000
0166 #define IP27PROM_DECOMP_BUF PHYS_TO_K0(0x01900000)
0167 #define IP27PROM_DECOMP_SIZE 0xfff00
0168
0169 #define IP27PROM_BASE PHYS_TO_K0(0x01a00000)
0170 #define IP27PROM_BASE_MAPPED (UNCAC_BASE | 0x1fc00000)
0171 #define IP27PROM_SIZE_MAX 0x100000
0172
0173 #define IP27PROM_PCFG PHYS_TO_K0(0x01b00000)
0174 #define IP27PROM_PCFG_SIZE 0xd0000
0175 #define IP27PROM_ERRDMP PHYS_TO_K1(0x01bd0000)
0176 #define IP27PROM_ERRDMP_SIZE 0xf000
0177
0178 #define IP27PROM_INIT_START PHYS_TO_K1(0x01bd0000)
0179 #define IP27PROM_CONSOLE PHYS_TO_K1(0x01bdf000)
0180 #define IP27PROM_CONSOLE_SIZE 0x200
0181 #define IP27PROM_NETUART PHYS_TO_K1(0x01bdf200)
0182 #define IP27PROM_NETUART_SIZE 0x100
0183 #define IP27PROM_UNUSED1 PHYS_TO_K1(0x01bdf300)
0184 #define IP27PROM_UNUSED1_SIZE 0x500
0185 #define IP27PROM_ELSC_BASE_A PHYS_TO_K0(0x01bdf800)
0186 #define IP27PROM_ELSC_BASE_B PHYS_TO_K0(0x01bdfc00)
0187 #define IP27PROM_STACK_A PHYS_TO_K0(0x01be0000)
0188 #define IP27PROM_STACK_B PHYS_TO_K0(0x01bf0000)
0189 #define IP27PROM_STACK_SHFT 16
0190 #define IP27PROM_STACK_SIZE (1 << IP27PROM_STACK_SHFT)
0191 #define IP27PROM_INIT_END PHYS_TO_K0(0x01c00000)
0192
0193 #define SLAVESTACK_BASE PHYS_TO_K0(0x01580000)
0194 #define SLAVESTACK_SIZE 0x40000
0195
0196 #define ENETBUFS_BASE PHYS_TO_K0(0x01f80000)
0197 #define ENETBUFS_SIZE 0x20000
0198
0199 #define IO6PROM_BASE PHYS_TO_K0(0x01c00000)
0200 #define IO6PROM_SIZE 0x400000
0201 #define IO6PROM_BASE_MAPPED (UNCAC_BASE | 0x11c00000)
0202 #define IO6DPROM_BASE PHYS_TO_K0(0x01c00000)
0203 #define IO6DPROM_SIZE 0x200000
0204
0205 #define NODEBUGUNIX_ADDR PHYS_TO_K0(0x00019000)
0206 #define DEBUGUNIX_ADDR PHYS_TO_K0(0x00100000)
0207
0208 #define IP27PROM_INT_LAUNCH 10
0209 #define IP27PROM_INT_NETUART 12
0210
0211 #endif
0212
0213
0214
0215
0216 #define IP27PROM_ELSC_SHFT 10
0217 #define IP27PROM_ELSC_SIZE (1 << IP27PROM_ELSC_SHFT)
0218
0219
0220
0221
0222
0223
0224
0225
0226 #define FREEMEM_BASE PHYS_TO_K0(0x2000000)
0227
0228 #define IO6PROM_STACK_SHFT 14
0229 #define IO6PROM_STACK_SIZE (1 << IO6PROM_STACK_SHFT)
0230
0231
0232
0233
0234
0235 #define IP27PROM_ENTRY PHYS_TO_COMPATK1(0x1fc00000)
0236 #define IP27PROM_RESTART PHYS_TO_COMPATK1(0x1fc00008)
0237 #define IP27PROM_SLAVELOOP PHYS_TO_COMPATK1(0x1fc00010)
0238 #define IP27PROM_PODMODE PHYS_TO_COMPATK1(0x1fc00018)
0239 #define IP27PROM_IOC3UARTPOD PHYS_TO_COMPATK1(0x1fc00020)
0240 #define IP27PROM_FLASHLEDS PHYS_TO_COMPATK1(0x1fc00028)
0241 #define IP27PROM_REPOD PHYS_TO_COMPATK1(0x1fc00030)
0242 #define IP27PROM_LAUNCHSLAVE PHYS_TO_COMPATK1(0x1fc00038)
0243 #define IP27PROM_WAITSLAVE PHYS_TO_COMPATK1(0x1fc00040)
0244 #define IP27PROM_POLLSLAVE PHYS_TO_COMPATK1(0x1fc00048)
0245
0246 #define KL_UART_BASE LOCAL_HUB_ADDR(MD_UREG0_0)
0247 #define KL_UART_CMD LOCAL_HUB_ADDR(MD_UREG0_0)
0248 #define KL_UART_DATA LOCAL_HUB_ADDR(MD_UREG0_1)
0249 #define KL_I2C_REG MD_UREG0_0
0250
0251 #ifndef __ASSEMBLY__
0252
0253
0254
0255
0256
0257 #if defined(HUB_ERR_STS_WAR)
0258 #define CACHE_ERR_EFRAME 0x480
0259 #else
0260 #define CACHE_ERR_EFRAME 0x400
0261 #endif
0262
0263 #define CACHE_ERR_ECCFRAME (CACHE_ERR_EFRAME + EF_SIZE)
0264 #define CACHE_ERR_SP_PTR (0x1000 - 32)
0265 #define CACHE_ERR_IBASE_PTR (0x1000 - 40)
0266 #define CACHE_ERR_SP (CACHE_ERR_SP_PTR - 16)
0267 #define CACHE_ERR_AREA_SIZE (ARCS_SPB_OFFSET - CACHE_ERR_EFRAME)
0268
0269 #endif
0270
0271 #define _ARCSPROM
0272
0273 #if defined(HUB_ERR_STS_WAR)
0274
0275 #define ERR_STS_WAR_REGISTER IIO_IIBUSERR
0276 #define ERR_STS_WAR_ADDR LOCAL_HUB_ADDR(IIO_IIBUSERR)
0277 #define ERR_STS_WAR_PHYSADDR TO_PHYS((__psunsigned_t)ERR_STS_WAR_ADDR)
0278
0279 #define OLD_ERR_STS_WAR_OFFSET ((MD_MEM_BANKS * MD_BANK_SIZE) - 0x100)
0280
0281 #endif
0282
0283 #endif