📄 tioca.h
字号:
#define CA_PCIERR_CMD_SHFT 36#define CA_PCIERR_A64 (1ull << 40)#define CA_PCIERR_SLV_SERR (1ull << 41)#define CA_PCIERR_SLV_WR_PERR (1ull << 42)#define CA_PCIERR_SLV_RD_PERR (1ull << 43)#define CA_PCIERR_MST_SERR (1ull << 44)#define CA_PCIERR_MST_WR_PERR (1ull << 45)#define CA_PCIERR_MST_RD_PERR (1ull << 46)#define CA_PCIERR_MST_MABT (1ull << 47)#define CA_PCIERR_MST_TABT (1ull << 48)#define CA_PCIERR_MST_RETRY_TOUT (1ull << 49)#define CA_PCIERR_TYPES \ (CA_PCIERR_A64|CA_PCIERR_SLV_SERR| \ CA_PCIERR_SLV_WR_PERR|CA_PCIERR_SLV_RD_PERR| \ CA_PCIERR_MST_SERR|CA_PCIERR_MST_WR_PERR|CA_PCIERR_MST_RD_PERR| \ CA_PCIERR_MST_MABT|CA_PCIERR_MST_TABT|CA_PCIERR_MST_RETRY_TOUT) /* bits 63:50 unused *//* ==== ca_pci_dma_addr_extn */#define CA_UPPER_NODE_OFFSET (0x3full << 0)#define CA_UPPER_NODE_OFFSET_SHFT 0 /* bits 7:6 unused */#define CA_CHIPLET_ID (0x3ull << 8)#define CA_CHIPLET_ID_SHFT 8 /* bits 11:10 unused */#define CA_PCI_DMA_NODE_ID (0xffffull << 12)#define CA_PCI_DMA_NODE_ID_SHFT 12 /* bits 27:26 unused */#define CA_PCI_DMA_PIO_MEM_TYPE (1ull << 28) /* bits 63:29 unused *//* ==== ca_agp_dma_addr_extn */ /* bits 19:0 unused */#define CA_AGP_DMA_NODE_ID (0xffffull << 20)#define CA_AGP_DMA_NODE_ID_SHFT 20 /* bits 27:26 unused */#define CA_AGP_DMA_PIO_MEM_TYPE (1ull << 28) /* bits 63:29 unused *//* ==== ca_debug_vector_sel */#define CA_DEBUG_MN_VSEL (0xfull << 0)#define CA_DEBUG_MN_VSEL_SHFT 0#define CA_DEBUG_PP_VSEL (0xfull << 4)#define CA_DEBUG_PP_VSEL_SHFT 4#define CA_DEBUG_GW_VSEL (0xfull << 8)#define CA_DEBUG_GW_VSEL_SHFT 8#define CA_DEBUG_GT_VSEL (0xfull << 12)#define CA_DEBUG_GT_VSEL_SHFT 12#define CA_DEBUG_PD_VSEL (0xfull << 16)#define CA_DEBUG_PD_VSEL_SHFT 16#define CA_DEBUG_AD_VSEL (0xfull << 20)#define CA_DEBUG_AD_VSEL_SHFT 20#define CA_DEBUG_CX_VSEL (0xfull << 24)#define CA_DEBUG_CX_VSEL_SHFT 24#define CA_DEBUG_CR_VSEL (0xfull << 28)#define CA_DEBUG_CR_VSEL_SHFT 28#define CA_DEBUG_BA_VSEL (0xfull << 32)#define CA_DEBUG_BA_VSEL_SHFT 32#define CA_DEBUG_PE_VSEL (0xfull << 36)#define CA_DEBUG_PE_VSEL_SHFT 36#define CA_DEBUG_BO_VSEL (0xfull << 40)#define CA_DEBUG_BO_VSEL_SHFT 40#define CA_DEBUG_BI_VSEL (0xfull << 44)#define CA_DEBUG_BI_VSEL_SHFT 44#define CA_DEBUG_AS_VSEL (0xfull << 48)#define CA_DEBUG_AS_VSEL_SHFT 48#define CA_DEBUG_PS_VSEL (0xfull << 52)#define CA_DEBUG_PS_VSEL_SHFT 52#define CA_DEBUG_PM_VSEL (0xfull << 56)#define CA_DEBUG_PM_VSEL_SHFT 56 /* bits 63:60 unused *//* ==== ca_debug_mux_core_sel *//* ==== ca_debug_mux_pci_sel */#define CA_DEBUG_MSEL0 (0x7ull << 0)#define CA_DEBUG_MSEL0_SHFT 0 /* bit 3 unused */#define CA_DEBUG_NSEL0 (0x7ull << 4)#define CA_DEBUG_NSEL0_SHFT 4 /* bit 7 unused */#define CA_DEBUG_MSEL1 (0x7ull << 8)#define CA_DEBUG_MSEL1_SHFT 8 /* bit 11 unused */#define CA_DEBUG_NSEL1 (0x7ull << 12)#define CA_DEBUG_NSEL1_SHFT 12 /* bit 15 unused */#define CA_DEBUG_MSEL2 (0x7ull << 16)#define CA_DEBUG_MSEL2_SHFT 16 /* bit 19 unused */#define CA_DEBUG_NSEL2 (0x7ull << 20)#define CA_DEBUG_NSEL2_SHFT 20 /* bit 23 unused */#define CA_DEBUG_MSEL3 (0x7ull << 24)#define CA_DEBUG_MSEL3_SHFT 24 /* bit 27 unused */#define CA_DEBUG_NSEL3 (0x7ull << 28)#define CA_DEBUG_NSEL3_SHFT 28 /* bit 31 unused */#define CA_DEBUG_MSEL4 (0x7ull << 32)#define CA_DEBUG_MSEL4_SHFT 32 /* bit 35 unused */#define CA_DEBUG_NSEL4 (0x7ull << 36)#define CA_DEBUG_NSEL4_SHFT 36 /* bit 39 unused */#define CA_DEBUG_MSEL5 (0x7ull << 40)#define CA_DEBUG_MSEL5_SHFT 40 /* bit 43 unused */#define CA_DEBUG_NSEL5 (0x7ull << 44)#define CA_DEBUG_NSEL5_SHFT 44 /* bit 47 unused */#define CA_DEBUG_MSEL6 (0x7ull << 48)#define CA_DEBUG_MSEL6_SHFT 48 /* bit 51 unused */#define CA_DEBUG_NSEL6 (0x7ull << 52)#define CA_DEBUG_NSEL6_SHFT 52 /* bit 55 unused */#define CA_DEBUG_MSEL7 (0x7ull << 56)#define CA_DEBUG_MSEL7_SHFT 56 /* bit 59 unused */#define CA_DEBUG_NSEL7 (0x7ull << 60)#define CA_DEBUG_NSEL7_SHFT 60 /* bit 63 unused *//* ==== ca_debug_domain_sel */#define CA_DEBUG_DOMAIN_L (1ull << 0)#define CA_DEBUG_DOMAIN_H (1ull << 1) /* bits 63:2 unused *//* ==== ca_gart_ptr_table */#define CA_GART_PTR_VAL (1ull << 0) /* bits 11:1 unused */#define CA_GART_PTR_ADDR (0xfffffffffffull << 12)#define CA_GART_PTR_ADDR_SHFT 12 /* bits 63:56 unused *//* ==== ca_gart_tlb_addr[0-7] */#define CA_GART_TLB_ADDR (0xffffffffffffffull << 0)#define CA_GART_TLB_ADDR_SHFT 0 /* bits 62:56 unused */#define CA_GART_TLB_ENTRY_VAL (1ull << 63)/* * PIO address space ranges for TIO:CA *//* CA internal registers */#define CA_PIO_ADMIN 0x00000000#define CA_PIO_ADMIN_LEN 0x00010000/* GFX Write Buffer - Diagnostics */#define CA_PIO_GFX 0x00010000#define CA_PIO_GFX_LEN 0x00010000/* AGP DMA Write Buffer - Diagnostics */#define CA_PIO_AGP_DMAWRITE 0x00020000#define CA_PIO_AGP_DMAWRITE_LEN 0x00010000/* AGP DMA READ Buffer - Diagnostics */#define CA_PIO_AGP_DMAREAD 0x00030000#define CA_PIO_AGP_DMAREAD_LEN 0x00010000/* PCI Config Type 0 */#define CA_PIO_PCI_TYPE0_CONFIG 0x01000000#define CA_PIO_PCI_TYPE0_CONFIG_LEN 0x01000000/* PCI Config Type 1 */#define CA_PIO_PCI_TYPE1_CONFIG 0x02000000#define CA_PIO_PCI_TYPE1_CONFIG_LEN 0x01000000/* PCI I/O Cycles - mapped to PCI Address 0x00000000-0x04ffffff */#define CA_PIO_PCI_IO 0x03000000#define CA_PIO_PCI_IO_LEN 0x05000000/* PCI MEM Cycles - mapped to PCI with CA_PIO_ADDR_OFFSET of ca_control1 *//* use Fast Write if enabled and coretalk packet type is a GFX request */#define CA_PIO_PCI_MEM_OFFSET 0x08000000#define CA_PIO_PCI_MEM_OFFSET_LEN 0x08000000/* PCI MEM Cycles - mapped to PCI Address 0x00000000-0xbfffffff *//* use Fast Write if enabled and coretalk packet type is a GFX request */#define CA_PIO_PCI_MEM 0x40000000#define CA_PIO_PCI_MEM_LEN 0xc0000000/* * DMA space * * The CA aperature (ie. bus address range) mapped by the GART is segmented into * two parts. The lower portion of the aperature is used for mapping 32 bit * PCI addresses which are managed by the dma interfaces in this file. The * upper poprtion of the aperature is used for mapping 48 bit AGP addresses. * The AGP portion of the aperature is managed by the agpgart_be.c driver * in drivers/linux/agp. There are ca-specific hooks in that driver to * manipulate the gart, but management of the AGP portion of the aperature * is the responsibility of that driver. * * CA allows three main types of DMA mapping: * * PCI 64-bit Managed by this driver * PCI 32-bit Managed by this driver * AGP 48-bit Managed by hooks in the /dev/agpgart driver * * All of the above can optionally be remapped through the GART. The following * table lists the combinations of addressing types and GART remapping that * is currently supported by the driver (h/w supports all, s/w limits this): * * PCI64 PCI32 AGP48 * GART no yes yes * Direct yes yes no * * GART remapping of PCI64 is not done because there is no need to. The * 64 bit PCI address holds all of the information necessary to target any * memory in the system. * * AGP48 is always mapped through the GART. Management of the AGP48 portion * of the aperature is the responsibility of code in the agpgart_be driver. * * The non-64 bit bus address space will currently be partitioned like this: * * 0xffff_ffff_ffff +-------- * | AGP48 direct * | Space managed by this driver * CA_AGP_DIRECT_BASE +-------- * | AGP GART mapped (gfx aperature) * | Space managed by /dev/agpgart driver * | This range is exposed to the agpgart * | driver as the "graphics aperature" * CA_AGP_MAPPED_BASE +----- * | PCI GART mapped * | Space managed by this driver * CA_PCI32_MAPPED_BASE +---- * | PCI32 direct * | Space managed by this driver * 0xC000_0000 +-------- * (CA_PCI32_DIRECT_BASE) * * The bus address range CA_PCI32_MAPPED_BASE through CA_AGP_DIRECT_BASE * is what we call the CA aperature. Addresses falling in this range will * be remapped using the GART. * * The bus address range CA_AGP_MAPPED_BASE through CA_AGP_DIRECT_BASE * is what we call the graphics aperature. This is a subset of the CA * aperature and is under the control of the agpgart_be driver. * * CA_PCI32_MAPPED_BASE, CA_AGP_MAPPED_BASE, and CA_AGP_DIRECT_BASE are * somewhat arbitrary values. The known constraints on choosing these is: * * 1) CA_AGP_DIRECT_BASE-CA_PCI32_MAPPED_BASE+1 (the CA aperature size) * must be one of the values supported by the ca_gart_aperature register. * Currently valid values are: 4MB through 4096MB in powers of 2 increments * * 2) CA_AGP_DIRECT_BASE-CA_AGP_MAPPED_BASE+1 (the gfx aperature size) * must be in MB units since that's what the agpgart driver assumes. *//* * Define Bus DMA ranges. These are configurable (see constraints above) * and will probably need tuning based on experience. *//* * 11/24/03 * CA has an addressing glitch w.r.t. PCI direct 32 bit DMA that makes it * generally unusable. The problem is that for PCI direct 32 * DMA's, all 32 bits of the bus address are used to form the lower 32 bits * of the coretalk address, and coretalk bits 38:32 come from a register. * Since only PCI bus addresses 0xC0000000-0xFFFFFFFF (1GB) are available * for DMA (the rest is allocated to PIO), host node addresses need to be * such that their lower 32 bits fall in the 0xC0000000-0xffffffff range * as well. So there can be no PCI32 direct DMA below 3GB!! For this * reason we set the CA_PCI32_DIRECT_SIZE to 0 which essentially makes * tioca_dma_direct32() a noop but preserves the code flow should this issue * be fixed in a respin. * * For now, all PCI32 DMA's must be mapped through the GART. */#define CA_PCI32_DIRECT_BASE 0xC0000000UL /* BASE not configurable */#define CA_PCI32_DIRECT_SIZE 0x00000000UL /* 0 MB */#define CA_PCI32_MAPPED_BASE 0xC0000000UL#define CA_PCI32_MAPPED_SIZE 0x40000000UL /* 2GB */#define CA_AGP_MAPPED_BASE 0x80000000UL#define CA_AGP_MAPPED_SIZE 0x40000000UL /* 2GB */#define CA_AGP_DIRECT_BASE 0x40000000UL /* 2GB */#define CA_AGP_DIRECT_SIZE 0x40000000UL#define CA_APERATURE_BASE (CA_AGP_MAPPED_BASE)#define CA_APERATURE_SIZE (CA_AGP_MAPPED_SIZE+CA_PCI32_MAPPED_SIZE)#endif /* _ASM_IA64_SN_TIO_TIOCA_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -