0001
0002 #ifndef __ALPHA_TITAN__H__
0003 #define __ALPHA_TITAN__H__
0004
0005 #include <linux/types.h>
0006 #include <asm/compiler.h>
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #ifdef USE_48_BIT_KSEG
0022 #define TI_BIAS 0x80000000000UL
0023 #else
0024 #define TI_BIAS 0x10000000000UL
0025 #endif
0026
0027
0028
0029
0030
0031 typedef struct {
0032 volatile unsigned long csr __attribute__((aligned(64)));
0033 } titan_64;
0034
0035 typedef struct {
0036 titan_64 csc;
0037 titan_64 mtr;
0038 titan_64 misc;
0039 titan_64 mpd;
0040 titan_64 aar0;
0041 titan_64 aar1;
0042 titan_64 aar2;
0043 titan_64 aar3;
0044 titan_64 dim0;
0045 titan_64 dim1;
0046 titan_64 dir0;
0047 titan_64 dir1;
0048 titan_64 drir;
0049 titan_64 prben;
0050 titan_64 iic0;
0051 titan_64 iic1;
0052 titan_64 mpr0;
0053 titan_64 mpr1;
0054 titan_64 mpr2;
0055 titan_64 mpr3;
0056 titan_64 rsvd[2];
0057 titan_64 ttr;
0058 titan_64 tdr;
0059 titan_64 dim2;
0060 titan_64 dim3;
0061 titan_64 dir2;
0062 titan_64 dir3;
0063 titan_64 iic2;
0064 titan_64 iic3;
0065 titan_64 pwr;
0066 titan_64 reserved[17];
0067 titan_64 cmonctla;
0068 titan_64 cmonctlb;
0069 titan_64 cmoncnt01;
0070 titan_64 cmoncnt23;
0071 titan_64 cpen;
0072 } titan_cchip;
0073
0074 typedef struct {
0075 titan_64 dsc;
0076 titan_64 str;
0077 titan_64 drev;
0078 titan_64 dsc2;
0079 } titan_dchip;
0080
0081 typedef struct {
0082 titan_64 wsba[4];
0083 titan_64 wsm[4];
0084 titan_64 tba[4];
0085 titan_64 pctl;
0086 titan_64 plat;
0087 titan_64 reserved0[2];
0088 union {
0089 struct {
0090 titan_64 serror;
0091 titan_64 serren;
0092 titan_64 serrset;
0093 titan_64 reserved0;
0094 titan_64 gperror;
0095 titan_64 gperren;
0096 titan_64 gperrset;
0097 titan_64 reserved1;
0098 titan_64 gtlbiv;
0099 titan_64 gtlbia;
0100 titan_64 reserved2[2];
0101 titan_64 sctl;
0102 titan_64 reserved3[3];
0103 } g;
0104 struct {
0105 titan_64 agperror;
0106 titan_64 agperren;
0107 titan_64 agperrset;
0108 titan_64 agplastwr;
0109 titan_64 aperror;
0110 titan_64 aperren;
0111 titan_64 aperrset;
0112 titan_64 reserved0;
0113 titan_64 atlbiv;
0114 titan_64 atlbia;
0115 titan_64 reserved1[6];
0116 } a;
0117 } port_specific;
0118 titan_64 sprst;
0119 titan_64 reserved1[31];
0120 } titan_pachip_port;
0121
0122 typedef struct {
0123 titan_pachip_port g_port;
0124 titan_pachip_port a_port;
0125 } titan_pachip;
0126
0127 #define TITAN_cchip ((titan_cchip *)(IDENT_ADDR+TI_BIAS+0x1A0000000UL))
0128 #define TITAN_dchip ((titan_dchip *)(IDENT_ADDR+TI_BIAS+0x1B0000800UL))
0129 #define TITAN_pachip0 ((titan_pachip *)(IDENT_ADDR+TI_BIAS+0x180000000UL))
0130 #define TITAN_pachip1 ((titan_pachip *)(IDENT_ADDR+TI_BIAS+0x380000000UL))
0131 extern unsigned TITAN_agp;
0132 extern int TITAN_bootcpu;
0133
0134
0135
0136
0137
0138 #define wsba_m_ena 0x1
0139 #define wsba_m_sg 0x2
0140 #define wsba_m_addr 0xFFF00000
0141 #define wmask_k_sz1gb 0x3FF00000
0142 union TPAchipWSBA {
0143 struct {
0144 unsigned wsba_v_ena : 1;
0145 unsigned wsba_v_sg : 1;
0146 unsigned wsba_v_rsvd1 : 18;
0147 unsigned wsba_v_addr : 12;
0148 unsigned wsba_v_rsvd2 : 32;
0149 } wsba_r_bits;
0150 int wsba_q_whole [2];
0151 };
0152
0153
0154
0155
0156
0157
0158
0159 #define pctl_m_fbtb 0x00000001
0160 #define pctl_m_thdis 0x00000002
0161 #define pctl_m_chaindis 0x00000004
0162 #define pctl_m_tgtlat 0x00000018
0163 #define pctl_m_hole 0x00000020
0164 #define pctl_m_mwin 0x00000040
0165 #define pctl_m_arbena 0x00000080
0166 #define pctl_m_prigrp 0x0000FF00
0167 #define pctl_m_ppri 0x00010000
0168 #define pctl_m_pcispd66 0x00020000
0169 #define pctl_m_cngstlt 0x003C0000
0170 #define pctl_m_ptpdesten 0x3FC00000
0171 #define pctl_m_dpcen 0x40000000
0172 #define pctl_m_apcen 0x0000000080000000UL
0173 #define pctl_m_dcrtv 0x0000000300000000UL
0174 #define pctl_m_en_stepping 0x0000000400000000UL
0175 #define apctl_m_rsvd1 0x000FFFF800000000UL
0176 #define apctl_m_agp_rate 0x0030000000000000UL
0177 #define apctl_m_agp_sba_en 0x0040000000000000UL
0178 #define apctl_m_agp_en 0x0080000000000000UL
0179 #define apctl_m_rsvd2 0x0100000000000000UL
0180 #define apctl_m_agp_present 0x0200000000000000UL
0181 #define apctl_agp_hp_rd 0x1C00000000000000UL
0182 #define apctl_agp_lp_rd 0xE000000000000000UL
0183 #define gpctl_m_rsvd 0xFFFFFFF800000000UL
0184 union TPAchipPCTL {
0185 struct {
0186 unsigned pctl_v_fbtb : 1;
0187 unsigned pctl_v_thdis : 1;
0188 unsigned pctl_v_chaindis : 1;
0189 unsigned pctl_v_tgtlat : 2;
0190 unsigned pctl_v_hole : 1;
0191 unsigned pctl_v_mwin : 1;
0192 unsigned pctl_v_arbena : 1;
0193 unsigned pctl_v_prigrp : 8;
0194 unsigned pctl_v_ppri : 1;
0195 unsigned pctl_v_pcispd66 : 1;
0196 unsigned pctl_v_cngstlt : 4;
0197 unsigned pctl_v_ptpdesten : 8;
0198 unsigned pctl_v_dpcen : 1;
0199 unsigned pctl_v_apcen : 1;
0200 unsigned pctl_v_dcrtv : 2;
0201 unsigned pctl_v_en_stepping :1;
0202 unsigned apctl_v_rsvd1 : 17;
0203 unsigned apctl_v_agp_rate : 2;
0204 unsigned apctl_v_agp_sba_en : 1;
0205 unsigned apctl_v_agp_en : 1;
0206 unsigned apctl_v_rsvd2 : 1;
0207 unsigned apctl_v_agp_present : 1;
0208 unsigned apctl_v_agp_hp_rd : 3;
0209 unsigned apctl_v_agp_lp_rd : 3;
0210 } pctl_r_bits;
0211 unsigned int pctl_l_whole [2];
0212 unsigned long pctl_q_whole;
0213 };
0214
0215
0216
0217
0218 union TPAchipSERR {
0219 struct {
0220 unsigned serr_v_lost_uecc : 1;
0221 unsigned serr_v_uecc : 1;
0222 unsigned serr_v_cre : 1;
0223 unsigned serr_v_nxio : 1;
0224 unsigned serr_v_lost_cre : 1;
0225 unsigned serr_v_rsvd0 : 10;
0226 unsigned serr_v_addr : 32;
0227 unsigned serr_v_rsvd1 : 5;
0228 unsigned serr_v_source : 2;
0229 unsigned serr_v_cmd : 2;
0230 unsigned serr_v_syn : 8;
0231 } serr_r_bits;
0232 unsigned int serr_l_whole[2];
0233 unsigned long serr_q_whole;
0234 };
0235
0236
0237
0238
0239 union TPAchipPERR {
0240 struct {
0241 unsigned long perr_v_lost : 1;
0242 unsigned long perr_v_serr : 1;
0243 unsigned long perr_v_perr : 1;
0244 unsigned long perr_v_dcrto : 1;
0245 unsigned long perr_v_sge : 1;
0246 unsigned long perr_v_ape : 1;
0247 unsigned long perr_v_ta : 1;
0248 unsigned long perr_v_dpe : 1;
0249 unsigned long perr_v_nds : 1;
0250 unsigned long perr_v_iptpr : 1;
0251 unsigned long perr_v_iptpw : 1;
0252 unsigned long perr_v_rsvd0 : 3;
0253 unsigned long perr_v_addr : 33;
0254 unsigned long perr_v_dac : 1;
0255 unsigned long perr_v_mwin : 1;
0256 unsigned long perr_v_rsvd1 : 3;
0257 unsigned long perr_v_cmd : 4;
0258 unsigned long perr_v_rsvd2 : 8;
0259 } perr_r_bits;
0260 unsigned int perr_l_whole[2];
0261 unsigned long perr_q_whole;
0262 };
0263
0264
0265
0266
0267 union TPAchipAGPERR {
0268 struct {
0269 unsigned agperr_v_lost : 1;
0270 unsigned agperr_v_lpqfull : 1;
0271 unsigned apgerr_v_hpqfull : 1;
0272 unsigned agperr_v_rescmd : 1;
0273 unsigned agperr_v_ipte : 1;
0274 unsigned agperr_v_ptp : 1;
0275 unsigned agperr_v_nowindow : 1;
0276 unsigned agperr_v_rsvd0 : 8;
0277 unsigned agperr_v_addr : 32;
0278 unsigned agperr_v_rsvd1 : 1;
0279 unsigned agperr_v_dac : 1;
0280 unsigned agperr_v_mwin : 1;
0281 unsigned agperr_v_cmd : 3;
0282 unsigned agperr_v_length : 6;
0283 unsigned agperr_v_fence : 1;
0284 unsigned agperr_v_rsvd2 : 4;
0285 } agperr_r_bits;
0286 unsigned int agperr_l_whole[2];
0287 unsigned long agperr_q_whole;
0288 };
0289
0290
0291
0292
0293
0294
0295
0296
0297 #define TITAN_HOSE_SHIFT (33)
0298 #define TITAN_HOSE(h) (((unsigned long)(h)) << TITAN_HOSE_SHIFT)
0299 #define TITAN_BASE (IDENT_ADDR + TI_BIAS)
0300 #define TITAN_MEM(h) (TITAN_BASE+TITAN_HOSE(h)+0x000000000UL)
0301 #define _TITAN_IACK_SC(h) (TITAN_BASE+TITAN_HOSE(h)+0x1F8000000UL)
0302 #define TITAN_IO(h) (TITAN_BASE+TITAN_HOSE(h)+0x1FC000000UL)
0303 #define TITAN_CONF(h) (TITAN_BASE+TITAN_HOSE(h)+0x1FE000000UL)
0304
0305 #define TITAN_HOSE_MASK TITAN_HOSE(3)
0306 #define TITAN_IACK_SC _TITAN_IACK_SC(0)
0307
0308
0309
0310
0311
0312
0313
0314 #define TITAN_IO_BIAS TITAN_IO(0)
0315 #define TITAN_MEM_BIAS TITAN_MEM(0)
0316
0317
0318 #define TITAN_IO_SPACE (TITAN_CONF(0) - TITAN_IO(0))
0319
0320
0321 #define TITAN_TIG_SPACE (TITAN_BASE + 0x100000000UL)
0322
0323
0324
0325 #define TITAN_DAC_OFFSET (1UL << 40)
0326
0327
0328
0329
0330 #define SCB_Q_SYSERR 0x620
0331 #define SCB_Q_PROCERR 0x630
0332 #define SCB_Q_SYSMCHK 0x660
0333 #define SCB_Q_PROCMCHK 0x670
0334 #define SCB_Q_SYSEVENT 0x680
0335 struct el_TITAN_sysdata_mcheck {
0336 u64 summary;
0337 u64 c_dirx;
0338 u64 c_misc;
0339 u64 p0_serror;
0340 u64 p0_gperror;
0341 u64 p0_aperror;
0342 u64 p0_agperror;
0343 u64 p1_serror;
0344 u64 p1_gperror;
0345 u64 p1_aperror;
0346 u64 p1_agperror;
0347 };
0348
0349
0350
0351
0352 struct el_PRIVATEER_envdata_mcheck {
0353 u64 summary;
0354 u64 c_dirx;
0355 u64 smir;
0356 u64 cpuir;
0357 u64 psir;
0358 u64 fault;
0359 u64 sys_doors;
0360 u64 temp_warn;
0361 u64 fan_ctrl;
0362 u64 code;
0363 u64 reserved;
0364 };
0365
0366 #ifdef __KERNEL__
0367
0368 #ifndef __EXTERN_INLINE
0369 #define __EXTERN_INLINE extern inline
0370 #define __IO_EXTERN_INLINE
0371 #endif
0372
0373
0374
0375
0376
0377
0378
0379
0380
0381
0382
0383 extern void __iomem *titan_ioportmap(unsigned long addr);
0384 extern void __iomem *titan_ioremap(unsigned long addr, unsigned long size);
0385 extern void titan_iounmap(volatile void __iomem *addr);
0386
0387 __EXTERN_INLINE int titan_is_ioaddr(unsigned long addr)
0388 {
0389 return addr >= TITAN_BASE;
0390 }
0391
0392 extern int titan_is_mmio(const volatile void __iomem *addr);
0393
0394 #undef __IO_PREFIX
0395 #define __IO_PREFIX titan
0396 #define titan_trivial_rw_bw 1
0397 #define titan_trivial_rw_lq 1
0398 #define titan_trivial_io_bw 1
0399 #define titan_trivial_io_lq 1
0400 #define titan_trivial_iounmap 0
0401 #include <asm/io_trivial.h>
0402
0403 #ifdef __IO_EXTERN_INLINE
0404 #undef __EXTERN_INLINE
0405 #undef __IO_EXTERN_INLINE
0406 #endif
0407
0408 #endif
0409
0410 #endif