Path: blob/master/arch/alpha/include/asm/core_titan.h
15126 views
#ifndef __ALPHA_TITAN__H__1#define __ALPHA_TITAN__H__23#include <linux/types.h>4#include <asm/compiler.h>56/*7* TITAN is the internal names for a core logic chipset which provides8* memory controller and PCI/AGP access for 21264 based systems.9*10* This file is based on:11*12* Titan Chipset Engineering Specification13* Revision 0.1214* 13 July 199915*16*/1718/* XXX: Do we need to conditionalize on this? */19#ifdef USE_48_BIT_KSEG20#define TI_BIAS 0x80000000000UL21#else22#define TI_BIAS 0x10000000000UL23#endif2425/*26* CChip, DChip, and PChip registers27*/2829typedef struct {30volatile unsigned long csr __attribute__((aligned(64)));31} titan_64;3233typedef struct {34titan_64 csc;35titan_64 mtr;36titan_64 misc;37titan_64 mpd;38titan_64 aar0;39titan_64 aar1;40titan_64 aar2;41titan_64 aar3;42titan_64 dim0;43titan_64 dim1;44titan_64 dir0;45titan_64 dir1;46titan_64 drir;47titan_64 prben;48titan_64 iic0;49titan_64 iic1;50titan_64 mpr0;51titan_64 mpr1;52titan_64 mpr2;53titan_64 mpr3;54titan_64 rsvd[2];55titan_64 ttr;56titan_64 tdr;57titan_64 dim2;58titan_64 dim3;59titan_64 dir2;60titan_64 dir3;61titan_64 iic2;62titan_64 iic3;63titan_64 pwr;64titan_64 reserved[17];65titan_64 cmonctla;66titan_64 cmonctlb;67titan_64 cmoncnt01;68titan_64 cmoncnt23;69titan_64 cpen;70} titan_cchip;7172typedef struct {73titan_64 dsc;74titan_64 str;75titan_64 drev;76titan_64 dsc2;77} titan_dchip;7879typedef struct {80titan_64 wsba[4];81titan_64 wsm[4];82titan_64 tba[4];83titan_64 pctl;84titan_64 plat;85titan_64 reserved0[2];86union {87struct {88titan_64 serror;89titan_64 serren;90titan_64 serrset;91titan_64 reserved0;92titan_64 gperror;93titan_64 gperren;94titan_64 gperrset;95titan_64 reserved1;96titan_64 gtlbiv;97titan_64 gtlbia;98titan_64 reserved2[2];99titan_64 sctl;100titan_64 reserved3[3];101} g;102struct {103titan_64 agperror;104titan_64 agperren;105titan_64 agperrset;106titan_64 agplastwr;107titan_64 aperror;108titan_64 aperren;109titan_64 aperrset;110titan_64 reserved0;111titan_64 atlbiv;112titan_64 atlbia;113titan_64 reserved1[6];114} a;115} port_specific;116titan_64 sprst;117titan_64 reserved1[31];118} titan_pachip_port;119120typedef struct {121titan_pachip_port g_port;122titan_pachip_port a_port;123} titan_pachip;124125#define TITAN_cchip ((titan_cchip *)(IDENT_ADDR+TI_BIAS+0x1A0000000UL))126#define TITAN_dchip ((titan_dchip *)(IDENT_ADDR+TI_BIAS+0x1B0000800UL))127#define TITAN_pachip0 ((titan_pachip *)(IDENT_ADDR+TI_BIAS+0x180000000UL))128#define TITAN_pachip1 ((titan_pachip *)(IDENT_ADDR+TI_BIAS+0x380000000UL))129extern unsigned TITAN_agp;130extern int TITAN_bootcpu;131132/*133* TITAN PA-chip Window Space Base Address register.134* (WSBA[0-2])135*/136#define wsba_m_ena 0x1137#define wsba_m_sg 0x2138#define wsba_m_addr 0xFFF00000139#define wmask_k_sz1gb 0x3FF00000140union TPAchipWSBA {141struct {142unsigned wsba_v_ena : 1;143unsigned wsba_v_sg : 1;144unsigned wsba_v_rsvd1 : 18;145unsigned wsba_v_addr : 12;146unsigned wsba_v_rsvd2 : 32;147} wsba_r_bits;148int wsba_q_whole [2];149};150151/*152* TITAN PA-chip Control Register153* This definition covers both the G-Port GPCTL and the A-PORT APCTL.154* Bits <51:0> are the same in both cases. APCTL<63:52> are only155* applicable to AGP.156*/157#define pctl_m_fbtb 0x00000001158#define pctl_m_thdis 0x00000002159#define pctl_m_chaindis 0x00000004160#define pctl_m_tgtlat 0x00000018161#define pctl_m_hole 0x00000020162#define pctl_m_mwin 0x00000040163#define pctl_m_arbena 0x00000080164#define pctl_m_prigrp 0x0000FF00165#define pctl_m_ppri 0x00010000166#define pctl_m_pcispd66 0x00020000167#define pctl_m_cngstlt 0x003C0000168#define pctl_m_ptpdesten 0x3FC00000169#define pctl_m_dpcen 0x40000000170#define pctl_m_apcen 0x0000000080000000UL171#define pctl_m_dcrtv 0x0000000300000000UL172#define pctl_m_en_stepping 0x0000000400000000UL173#define apctl_m_rsvd1 0x000FFFF800000000UL174#define apctl_m_agp_rate 0x0030000000000000UL175#define apctl_m_agp_sba_en 0x0040000000000000UL176#define apctl_m_agp_en 0x0080000000000000UL177#define apctl_m_rsvd2 0x0100000000000000UL178#define apctl_m_agp_present 0x0200000000000000UL179#define apctl_agp_hp_rd 0x1C00000000000000UL180#define apctl_agp_lp_rd 0xE000000000000000UL181#define gpctl_m_rsvd 0xFFFFFFF800000000UL182union TPAchipPCTL {183struct {184unsigned pctl_v_fbtb : 1; /* A/G [0] */185unsigned pctl_v_thdis : 1; /* A/G [1] */186unsigned pctl_v_chaindis : 1; /* A/G [2] */187unsigned pctl_v_tgtlat : 2; /* A/G [4:3] */188unsigned pctl_v_hole : 1; /* A/G [5] */189unsigned pctl_v_mwin : 1; /* A/G [6] */190unsigned pctl_v_arbena : 1; /* A/G [7] */191unsigned pctl_v_prigrp : 8; /* A/G [15:8] */192unsigned pctl_v_ppri : 1; /* A/G [16] */193unsigned pctl_v_pcispd66 : 1; /* A/G [17] */194unsigned pctl_v_cngstlt : 4; /* A/G [21:18] */195unsigned pctl_v_ptpdesten : 8; /* A/G [29:22] */196unsigned pctl_v_dpcen : 1; /* A/G [30] */197unsigned pctl_v_apcen : 1; /* A/G [31] */198unsigned pctl_v_dcrtv : 2; /* A/G [33:32] */199unsigned pctl_v_en_stepping :1; /* A/G [34] */200unsigned apctl_v_rsvd1 : 17; /* A [51:35] */201unsigned apctl_v_agp_rate : 2; /* A [53:52] */202unsigned apctl_v_agp_sba_en : 1; /* A [54] */203unsigned apctl_v_agp_en : 1; /* A [55] */204unsigned apctl_v_rsvd2 : 1; /* A [56] */205unsigned apctl_v_agp_present : 1; /* A [57] */206unsigned apctl_v_agp_hp_rd : 3; /* A [60:58] */207unsigned apctl_v_agp_lp_rd : 3; /* A [63:61] */208} pctl_r_bits;209unsigned int pctl_l_whole [2];210unsigned long pctl_q_whole;211};212213/*214* SERROR / SERREN / SERRSET215*/216union TPAchipSERR {217struct {218unsigned serr_v_lost_uecc : 1; /* [0] */219unsigned serr_v_uecc : 1; /* [1] */220unsigned serr_v_cre : 1; /* [2] */221unsigned serr_v_nxio : 1; /* [3] */222unsigned serr_v_lost_cre : 1; /* [4] */223unsigned serr_v_rsvd0 : 10; /* [14:5] */224unsigned serr_v_addr : 32; /* [46:15] */225unsigned serr_v_rsvd1 : 5; /* [51:47] */226unsigned serr_v_source : 2; /* [53:52] */227unsigned serr_v_cmd : 2; /* [55:54] */228unsigned serr_v_syn : 8; /* [63:56] */229} serr_r_bits;230unsigned int serr_l_whole[2];231unsigned long serr_q_whole;232};233234/*235* GPERROR / APERROR / GPERREN / APERREN / GPERRSET / APERRSET236*/237union TPAchipPERR {238struct {239unsigned long perr_v_lost : 1; /* [0] */240unsigned long perr_v_serr : 1; /* [1] */241unsigned long perr_v_perr : 1; /* [2] */242unsigned long perr_v_dcrto : 1; /* [3] */243unsigned long perr_v_sge : 1; /* [4] */244unsigned long perr_v_ape : 1; /* [5] */245unsigned long perr_v_ta : 1; /* [6] */246unsigned long perr_v_dpe : 1; /* [7] */247unsigned long perr_v_nds : 1; /* [8] */248unsigned long perr_v_iptpr : 1; /* [9] */249unsigned long perr_v_iptpw : 1; /* [10] */250unsigned long perr_v_rsvd0 : 3; /* [13:11] */251unsigned long perr_v_addr : 33; /* [46:14] */252unsigned long perr_v_dac : 1; /* [47] */253unsigned long perr_v_mwin : 1; /* [48] */254unsigned long perr_v_rsvd1 : 3; /* [51:49] */255unsigned long perr_v_cmd : 4; /* [55:52] */256unsigned long perr_v_rsvd2 : 8; /* [63:56] */257} perr_r_bits;258unsigned int perr_l_whole[2];259unsigned long perr_q_whole;260};261262/*263* AGPERROR / AGPERREN / AGPERRSET264*/265union TPAchipAGPERR {266struct {267unsigned agperr_v_lost : 1; /* [0] */268unsigned agperr_v_lpqfull : 1; /* [1] */269unsigned apgerr_v_hpqfull : 1; /* [2] */270unsigned agperr_v_rescmd : 1; /* [3] */271unsigned agperr_v_ipte : 1; /* [4] */272unsigned agperr_v_ptp : 1; /* [5] */273unsigned agperr_v_nowindow : 1; /* [6] */274unsigned agperr_v_rsvd0 : 8; /* [14:7] */275unsigned agperr_v_addr : 32; /* [46:15] */276unsigned agperr_v_rsvd1 : 1; /* [47] */277unsigned agperr_v_dac : 1; /* [48] */278unsigned agperr_v_mwin : 1; /* [49] */279unsigned agperr_v_cmd : 3; /* [52:50] */280unsigned agperr_v_length : 6; /* [58:53] */281unsigned agperr_v_fence : 1; /* [59] */282unsigned agperr_v_rsvd2 : 4; /* [63:60] */283} agperr_r_bits;284unsigned int agperr_l_whole[2];285unsigned long agperr_q_whole;286};287/*288* Memory spaces:289* Hose numbers are assigned as follows:290* 0 - pachip 0 / G Port291* 1 - pachip 1 / G Port292* 2 - pachip 0 / A Port293* 3 - pachip 1 / A Port294*/295#define TITAN_HOSE_SHIFT (33)296#define TITAN_HOSE(h) (((unsigned long)(h)) << TITAN_HOSE_SHIFT)297#define TITAN_BASE (IDENT_ADDR + TI_BIAS)298#define TITAN_MEM(h) (TITAN_BASE+TITAN_HOSE(h)+0x000000000UL)299#define _TITAN_IACK_SC(h) (TITAN_BASE+TITAN_HOSE(h)+0x1F8000000UL)300#define TITAN_IO(h) (TITAN_BASE+TITAN_HOSE(h)+0x1FC000000UL)301#define TITAN_CONF(h) (TITAN_BASE+TITAN_HOSE(h)+0x1FE000000UL)302303#define TITAN_HOSE_MASK TITAN_HOSE(3)304#define TITAN_IACK_SC _TITAN_IACK_SC(0) /* hack! */305306/*307* The canonical non-remaped I/O and MEM addresses have these values308* subtracted out. This is arranged so that folks manipulating ISA309* devices can use their familiar numbers and have them map to bus 0.310*/311312#define TITAN_IO_BIAS TITAN_IO(0)313#define TITAN_MEM_BIAS TITAN_MEM(0)314315/* The IO address space is larger than 0xffff */316#define TITAN_IO_SPACE (TITAN_CONF(0) - TITAN_IO(0))317318/* TIG Space */319#define TITAN_TIG_SPACE (TITAN_BASE + 0x100000000UL)320321/* Offset between ram physical addresses and pci64 DAC bus addresses. */322/* ??? Just a guess. Ought to confirm it hasn't been moved. */323#define TITAN_DAC_OFFSET (1UL << 40)324325/*326* Data structure for handling TITAN machine checks:327*/328#define SCB_Q_SYSERR 0x620329#define SCB_Q_PROCERR 0x630330#define SCB_Q_SYSMCHK 0x660331#define SCB_Q_PROCMCHK 0x670332#define SCB_Q_SYSEVENT 0x680 /* environmental / system management */333struct el_TITAN_sysdata_mcheck {334u64 summary; /* 0x00 */335u64 c_dirx; /* 0x08 */336u64 c_misc; /* 0x10 */337u64 p0_serror; /* 0x18 */338u64 p0_gperror; /* 0x20 */339u64 p0_aperror; /* 0x28 */340u64 p0_agperror;/* 0x30 */341u64 p1_serror; /* 0x38 */342u64 p1_gperror; /* 0x40 */343u64 p1_aperror; /* 0x48 */344u64 p1_agperror;/* 0x50 */345};346347/*348* System area for a privateer 680 environmental/system management mcheck349*/350struct el_PRIVATEER_envdata_mcheck {351u64 summary; /* 0x00 */352u64 c_dirx; /* 0x08 */353u64 smir; /* 0x10 */354u64 cpuir; /* 0x18 */355u64 psir; /* 0x20 */356u64 fault; /* 0x28 */357u64 sys_doors; /* 0x30 */358u64 temp_warn; /* 0x38 */359u64 fan_ctrl; /* 0x40 */360u64 code; /* 0x48 */361u64 reserved; /* 0x50 */362};363364#ifdef __KERNEL__365366#ifndef __EXTERN_INLINE367#define __EXTERN_INLINE extern inline368#define __IO_EXTERN_INLINE369#endif370371/*372* I/O functions:373*374* TITAN, a 21??? PCI/memory support chipset for the EV6 (21264)375* can only use linear accesses to get at PCI/AGP memory and I/O spaces.376*/377378/*379* Memory functions. all accesses are done through linear space.380*/381extern void __iomem *titan_ioportmap(unsigned long addr);382extern void __iomem *titan_ioremap(unsigned long addr, unsigned long size);383extern void titan_iounmap(volatile void __iomem *addr);384385__EXTERN_INLINE int titan_is_ioaddr(unsigned long addr)386{387return addr >= TITAN_BASE;388}389390extern int titan_is_mmio(const volatile void __iomem *addr);391392#undef __IO_PREFIX393#define __IO_PREFIX titan394#define titan_trivial_rw_bw 1395#define titan_trivial_rw_lq 1396#define titan_trivial_io_bw 1397#define titan_trivial_io_lq 1398#define titan_trivial_iounmap 0399#include <asm/io_trivial.h>400401#ifdef __IO_EXTERN_INLINE402#undef __EXTERN_INLINE403#undef __IO_EXTERN_INLINE404#endif405406#endif /* __KERNEL__ */407408#endif /* __ALPHA_TITAN__H__ */409410411