Path: blob/master/arch/alpha/include/asm/core_tsunami.h
15126 views
#ifndef __ALPHA_TSUNAMI__H__1#define __ALPHA_TSUNAMI__H__23#include <linux/types.h>4#include <asm/compiler.h>56/*7* TSUNAMI/TYPHOON are the internal names for the core logic chipset which8* provides memory controller and PCI access for the 21264 based systems.9*10* This file is based on:11*12* Tsunami System Programmers Manual13* Preliminary, Chapters 2-514*15*/1617/* XXX: Do we need to conditionalize on this? */18#ifdef USE_48_BIT_KSEG19#define TS_BIAS 0x80000000000UL20#else21#define TS_BIAS 0x10000000000UL22#endif2324/*25* CChip, DChip, and PChip registers26*/2728typedef struct {29volatile unsigned long csr __attribute__((aligned(64)));30} tsunami_64;3132typedef struct {33tsunami_64 csc;34tsunami_64 mtr;35tsunami_64 misc;36tsunami_64 mpd;37tsunami_64 aar0;38tsunami_64 aar1;39tsunami_64 aar2;40tsunami_64 aar3;41tsunami_64 dim0;42tsunami_64 dim1;43tsunami_64 dir0;44tsunami_64 dir1;45tsunami_64 drir;46tsunami_64 prben;47tsunami_64 iic; /* a.k.a. iic0 */48tsunami_64 wdr; /* a.k.a. iic1 */49tsunami_64 mpr0;50tsunami_64 mpr1;51tsunami_64 mpr2;52tsunami_64 mpr3;53tsunami_64 mctl;54tsunami_64 __pad1;55tsunami_64 ttr;56tsunami_64 tdr;57tsunami_64 dim2;58tsunami_64 dim3;59tsunami_64 dir2;60tsunami_64 dir3;61tsunami_64 iic2;62tsunami_64 iic3;63} tsunami_cchip;6465typedef struct {66tsunami_64 dsc;67tsunami_64 str;68tsunami_64 drev;69} tsunami_dchip;7071typedef struct {72tsunami_64 wsba[4];73tsunami_64 wsm[4];74tsunami_64 tba[4];75tsunami_64 pctl;76tsunami_64 plat;77tsunami_64 reserved;78tsunami_64 perror;79tsunami_64 perrmask;80tsunami_64 perrset;81tsunami_64 tlbiv;82tsunami_64 tlbia;83tsunami_64 pmonctl;84tsunami_64 pmoncnt;85} tsunami_pchip;8687#define TSUNAMI_cchip ((tsunami_cchip *)(IDENT_ADDR+TS_BIAS+0x1A0000000UL))88#define TSUNAMI_dchip ((tsunami_dchip *)(IDENT_ADDR+TS_BIAS+0x1B0000800UL))89#define TSUNAMI_pchip0 ((tsunami_pchip *)(IDENT_ADDR+TS_BIAS+0x180000000UL))90#define TSUNAMI_pchip1 ((tsunami_pchip *)(IDENT_ADDR+TS_BIAS+0x380000000UL))91extern int TSUNAMI_bootcpu;9293/*94* TSUNAMI Pchip Error register.95*/9697#define perror_m_lost 0x198#define perror_m_serr 0x299#define perror_m_perr 0x4100#define perror_m_dcrto 0x8101#define perror_m_sge 0x10102#define perror_m_ape 0x20103#define perror_m_ta 0x40104#define perror_m_rdpe 0x80105#define perror_m_nds 0x100106#define perror_m_rto 0x200107#define perror_m_uecc 0x400108#define perror_m_cre 0x800109#define perror_m_addrl 0xFFFFFFFF0000UL110#define perror_m_addrh 0x7000000000000UL111#define perror_m_cmd 0xF0000000000000UL112#define perror_m_syn 0xFF00000000000000UL113union TPchipPERROR {114struct {115unsigned int perror_v_lost : 1;116unsigned perror_v_serr : 1;117unsigned perror_v_perr : 1;118unsigned perror_v_dcrto : 1;119unsigned perror_v_sge : 1;120unsigned perror_v_ape : 1;121unsigned perror_v_ta : 1;122unsigned perror_v_rdpe : 1;123unsigned perror_v_nds : 1;124unsigned perror_v_rto : 1;125unsigned perror_v_uecc : 1;126unsigned perror_v_cre : 1;127unsigned perror_v_rsvd1 : 4;128unsigned perror_v_addrl : 32;129unsigned perror_v_addrh : 3;130unsigned perror_v_rsvd2 : 1;131unsigned perror_v_cmd : 4;132unsigned perror_v_syn : 8;133} perror_r_bits;134int perror_q_whole [2];135};136137/*138* TSUNAMI Pchip Window Space Base Address register.139*/140#define wsba_m_ena 0x1141#define wsba_m_sg 0x2142#define wsba_m_ptp 0x4143#define wsba_m_addr 0xFFF00000144#define wmask_k_sz1gb 0x3FF00000145union TPchipWSBA {146struct {147unsigned wsba_v_ena : 1;148unsigned wsba_v_sg : 1;149unsigned wsba_v_ptp : 1;150unsigned wsba_v_rsvd1 : 17;151unsigned wsba_v_addr : 12;152unsigned wsba_v_rsvd2 : 32;153} wsba_r_bits;154int wsba_q_whole [2];155};156157/*158* TSUNAMI Pchip Control Register159*/160#define pctl_m_fdsc 0x1161#define pctl_m_fbtb 0x2162#define pctl_m_thdis 0x4163#define pctl_m_chaindis 0x8164#define pctl_m_tgtlat 0x10165#define pctl_m_hole 0x20166#define pctl_m_mwin 0x40167#define pctl_m_arbena 0x80168#define pctl_m_prigrp 0x7F00169#define pctl_m_ppri 0x8000170#define pctl_m_rsvd1 0x30000171#define pctl_m_eccen 0x40000172#define pctl_m_padm 0x80000173#define pctl_m_cdqmax 0xF00000174#define pctl_m_rev 0xFF000000175#define pctl_m_crqmax 0xF00000000UL176#define pctl_m_ptpmax 0xF000000000UL177#define pctl_m_pclkx 0x30000000000UL178#define pctl_m_fdsdis 0x40000000000UL179#define pctl_m_fdwdis 0x80000000000UL180#define pctl_m_ptevrfy 0x100000000000UL181#define pctl_m_rpp 0x200000000000UL182#define pctl_m_pid 0xC00000000000UL183#define pctl_m_rsvd2 0xFFFF000000000000UL184185union TPchipPCTL {186struct {187unsigned pctl_v_fdsc : 1;188unsigned pctl_v_fbtb : 1;189unsigned pctl_v_thdis : 1;190unsigned pctl_v_chaindis : 1;191unsigned pctl_v_tgtlat : 1;192unsigned pctl_v_hole : 1;193unsigned pctl_v_mwin : 1;194unsigned pctl_v_arbena : 1;195unsigned pctl_v_prigrp : 7;196unsigned pctl_v_ppri : 1;197unsigned pctl_v_rsvd1 : 2;198unsigned pctl_v_eccen : 1;199unsigned pctl_v_padm : 1;200unsigned pctl_v_cdqmax : 4;201unsigned pctl_v_rev : 8;202unsigned pctl_v_crqmax : 4;203unsigned pctl_v_ptpmax : 4;204unsigned pctl_v_pclkx : 2;205unsigned pctl_v_fdsdis : 1;206unsigned pctl_v_fdwdis : 1;207unsigned pctl_v_ptevrfy : 1;208unsigned pctl_v_rpp : 1;209unsigned pctl_v_pid : 2;210unsigned pctl_v_rsvd2 : 16;211} pctl_r_bits;212int pctl_q_whole [2];213};214215/*216* TSUNAMI Pchip Error Mask Register.217*/218#define perrmask_m_lost 0x1219#define perrmask_m_serr 0x2220#define perrmask_m_perr 0x4221#define perrmask_m_dcrto 0x8222#define perrmask_m_sge 0x10223#define perrmask_m_ape 0x20224#define perrmask_m_ta 0x40225#define perrmask_m_rdpe 0x80226#define perrmask_m_nds 0x100227#define perrmask_m_rto 0x200228#define perrmask_m_uecc 0x400229#define perrmask_m_cre 0x800230#define perrmask_m_rsvd 0xFFFFFFFFFFFFF000UL231union TPchipPERRMASK {232struct {233unsigned int perrmask_v_lost : 1;234unsigned perrmask_v_serr : 1;235unsigned perrmask_v_perr : 1;236unsigned perrmask_v_dcrto : 1;237unsigned perrmask_v_sge : 1;238unsigned perrmask_v_ape : 1;239unsigned perrmask_v_ta : 1;240unsigned perrmask_v_rdpe : 1;241unsigned perrmask_v_nds : 1;242unsigned perrmask_v_rto : 1;243unsigned perrmask_v_uecc : 1;244unsigned perrmask_v_cre : 1;245unsigned perrmask_v_rsvd1 : 20;246unsigned perrmask_v_rsvd2 : 32;247} perrmask_r_bits;248int perrmask_q_whole [2];249};250251/*252* Memory spaces:253*/254#define TSUNAMI_HOSE(h) (((unsigned long)(h)) << 33)255#define TSUNAMI_BASE (IDENT_ADDR + TS_BIAS)256257#define TSUNAMI_MEM(h) (TSUNAMI_BASE+TSUNAMI_HOSE(h) + 0x000000000UL)258#define _TSUNAMI_IACK_SC(h) (TSUNAMI_BASE+TSUNAMI_HOSE(h) + 0x1F8000000UL)259#define TSUNAMI_IO(h) (TSUNAMI_BASE+TSUNAMI_HOSE(h) + 0x1FC000000UL)260#define TSUNAMI_CONF(h) (TSUNAMI_BASE+TSUNAMI_HOSE(h) + 0x1FE000000UL)261262#define TSUNAMI_IACK_SC _TSUNAMI_IACK_SC(0) /* hack! */263264265/*266* The canonical non-remaped I/O and MEM addresses have these values267* subtracted out. This is arranged so that folks manipulating ISA268* devices can use their familiar numbers and have them map to bus 0.269*/270271#define TSUNAMI_IO_BIAS TSUNAMI_IO(0)272#define TSUNAMI_MEM_BIAS TSUNAMI_MEM(0)273274/* The IO address space is larger than 0xffff */275#define TSUNAMI_IO_SPACE (TSUNAMI_CONF(0) - TSUNAMI_IO(0))276277/* Offset between ram physical addresses and pci64 DAC bus addresses. */278#define TSUNAMI_DAC_OFFSET (1UL << 40)279280/*281* Data structure for handling TSUNAMI machine checks:282*/283struct el_TSUNAMI_sysdata_mcheck {284};285286287#ifdef __KERNEL__288289#ifndef __EXTERN_INLINE290#define __EXTERN_INLINE extern inline291#define __IO_EXTERN_INLINE292#endif293294/*295* I/O functions:296*297* TSUNAMI, the 21??? PCI/memory support chipset for the EV6 (21264)298* can only use linear accesses to get at PCI memory and I/O spaces.299*/300301/*302* Memory functions. all accesses are done through linear space.303*/304extern void __iomem *tsunami_ioportmap(unsigned long addr);305extern void __iomem *tsunami_ioremap(unsigned long addr, unsigned long size);306__EXTERN_INLINE int tsunami_is_ioaddr(unsigned long addr)307{308return addr >= TSUNAMI_BASE;309}310311__EXTERN_INLINE int tsunami_is_mmio(const volatile void __iomem *xaddr)312{313unsigned long addr = (unsigned long) xaddr;314return (addr & 0x100000000UL) == 0;315}316317#undef __IO_PREFIX318#define __IO_PREFIX tsunami319#define tsunami_trivial_rw_bw 1320#define tsunami_trivial_rw_lq 1321#define tsunami_trivial_io_bw 1322#define tsunami_trivial_io_lq 1323#define tsunami_trivial_iounmap 1324#include <asm/io_trivial.h>325326#ifdef __IO_EXTERN_INLINE327#undef __EXTERN_INLINE328#undef __IO_EXTERN_INLINE329#endif330331#endif /* __KERNEL__ */332333#endif /* __ALPHA_TSUNAMI__H__ */334335336