0001
0002 #ifndef LINUX_BCMA_DRIVER_PCIE2_H_
0003 #define LINUX_BCMA_DRIVER_PCIE2_H_
0004
0005 #define BCMA_CORE_PCIE2_CLK_CONTROL 0x0000
0006 #define PCIE2_CLKC_RST_OE 0x0001
0007 #define PCIE2_CLKC_RST 0x0002
0008 #define PCIE2_CLKC_SPERST 0x0004
0009 #define PCIE2_CLKC_DISABLE_L1CLK_GATING 0x0010
0010 #define PCIE2_CLKC_DLYPERST 0x0100
0011 #define PCIE2_CLKC_DISSPROMLD 0x0200
0012 #define PCIE2_CLKC_WAKE_MODE_L2 0x1000
0013 #define BCMA_CORE_PCIE2_RC_PM_CONTROL 0x0004
0014 #define BCMA_CORE_PCIE2_RC_PM_STATUS 0x0008
0015 #define BCMA_CORE_PCIE2_EP_PM_CONTROL 0x000C
0016 #define BCMA_CORE_PCIE2_EP_PM_STATUS 0x0010
0017 #define BCMA_CORE_PCIE2_EP_LTR_CONTROL 0x0014
0018 #define BCMA_CORE_PCIE2_EP_LTR_STATUS 0x0018
0019 #define BCMA_CORE_PCIE2_EP_OBFF_STATUS 0x001C
0020 #define BCMA_CORE_PCIE2_PCIE_ERR_STATUS 0x0020
0021 #define BCMA_CORE_PCIE2_RC_AXI_CONFIG 0x0100
0022 #define BCMA_CORE_PCIE2_EP_AXI_CONFIG 0x0104
0023 #define BCMA_CORE_PCIE2_RXDEBUG_STATUS0 0x0108
0024 #define BCMA_CORE_PCIE2_RXDEBUG_CONTROL0 0x010C
0025 #define BCMA_CORE_PCIE2_CONFIGINDADDR 0x0120
0026 #define BCMA_CORE_PCIE2_CONFIGINDDATA 0x0124
0027 #define BCMA_CORE_PCIE2_MDIOCONTROL 0x0128
0028 #define BCMA_CORE_PCIE2_MDIOWRDATA 0x012C
0029 #define BCMA_CORE_PCIE2_MDIORDDATA 0x0130
0030 #define BCMA_CORE_PCIE2_DATAINTF 0x0180
0031 #define BCMA_CORE_PCIE2_D2H_INTRLAZY_0 0x0188
0032 #define BCMA_CORE_PCIE2_H2D_INTRLAZY_0 0x018c
0033 #define BCMA_CORE_PCIE2_H2D_INTSTAT_0 0x0190
0034 #define BCMA_CORE_PCIE2_H2D_INTMASK_0 0x0194
0035 #define BCMA_CORE_PCIE2_D2H_INTSTAT_0 0x0198
0036 #define BCMA_CORE_PCIE2_D2H_INTMASK_0 0x019c
0037 #define BCMA_CORE_PCIE2_LTR_STATE 0x01A0
0038 #define PCIE2_LTR_ACTIVE 2
0039 #define PCIE2_LTR_ACTIVE_IDLE 1
0040 #define PCIE2_LTR_SLEEP 0
0041 #define PCIE2_LTR_FINAL_MASK 0x300
0042 #define PCIE2_LTR_FINAL_SHIFT 8
0043 #define BCMA_CORE_PCIE2_PWR_INT_STATUS 0x01A4
0044 #define BCMA_CORE_PCIE2_PWR_INT_MASK 0x01A8
0045 #define BCMA_CORE_PCIE2_CFG_ADDR 0x01F8
0046 #define BCMA_CORE_PCIE2_CFG_DATA 0x01FC
0047 #define BCMA_CORE_PCIE2_SYS_EQ_PAGE 0x0200
0048 #define BCMA_CORE_PCIE2_SYS_MSI_PAGE 0x0204
0049 #define BCMA_CORE_PCIE2_SYS_MSI_INTREN 0x0208
0050 #define BCMA_CORE_PCIE2_SYS_MSI_CTRL0 0x0210
0051 #define BCMA_CORE_PCIE2_SYS_MSI_CTRL1 0x0214
0052 #define BCMA_CORE_PCIE2_SYS_MSI_CTRL2 0x0218
0053 #define BCMA_CORE_PCIE2_SYS_MSI_CTRL3 0x021C
0054 #define BCMA_CORE_PCIE2_SYS_MSI_CTRL4 0x0220
0055 #define BCMA_CORE_PCIE2_SYS_MSI_CTRL5 0x0224
0056 #define BCMA_CORE_PCIE2_SYS_EQ_HEAD0 0x0250
0057 #define BCMA_CORE_PCIE2_SYS_EQ_TAIL0 0x0254
0058 #define BCMA_CORE_PCIE2_SYS_EQ_HEAD1 0x0258
0059 #define BCMA_CORE_PCIE2_SYS_EQ_TAIL1 0x025C
0060 #define BCMA_CORE_PCIE2_SYS_EQ_HEAD2 0x0260
0061 #define BCMA_CORE_PCIE2_SYS_EQ_TAIL2 0x0264
0062 #define BCMA_CORE_PCIE2_SYS_EQ_HEAD3 0x0268
0063 #define BCMA_CORE_PCIE2_SYS_EQ_TAIL3 0x026C
0064 #define BCMA_CORE_PCIE2_SYS_EQ_HEAD4 0x0270
0065 #define BCMA_CORE_PCIE2_SYS_EQ_TAIL4 0x0274
0066 #define BCMA_CORE_PCIE2_SYS_EQ_HEAD5 0x0278
0067 #define BCMA_CORE_PCIE2_SYS_EQ_TAIL5 0x027C
0068 #define BCMA_CORE_PCIE2_SYS_RC_INTX_EN 0x0330
0069 #define BCMA_CORE_PCIE2_SYS_RC_INTX_CSR 0x0334
0070 #define BCMA_CORE_PCIE2_SYS_MSI_REQ 0x0340
0071 #define BCMA_CORE_PCIE2_SYS_HOST_INTR_EN 0x0344
0072 #define BCMA_CORE_PCIE2_SYS_HOST_INTR_CSR 0x0348
0073 #define BCMA_CORE_PCIE2_SYS_HOST_INTR0 0x0350
0074 #define BCMA_CORE_PCIE2_SYS_HOST_INTR1 0x0354
0075 #define BCMA_CORE_PCIE2_SYS_HOST_INTR2 0x0358
0076 #define BCMA_CORE_PCIE2_SYS_HOST_INTR3 0x035C
0077 #define BCMA_CORE_PCIE2_SYS_EP_INT_EN0 0x0360
0078 #define BCMA_CORE_PCIE2_SYS_EP_INT_EN1 0x0364
0079 #define BCMA_CORE_PCIE2_SYS_EP_INT_CSR0 0x0370
0080 #define BCMA_CORE_PCIE2_SYS_EP_INT_CSR1 0x0374
0081 #define BCMA_CORE_PCIE2_SPROM(wordoffset) (0x0800 + ((wordoffset) * 2))
0082 #define BCMA_CORE_PCIE2_FUNC0_IMAP0_0 0x0C00
0083 #define BCMA_CORE_PCIE2_FUNC0_IMAP0_1 0x0C04
0084 #define BCMA_CORE_PCIE2_FUNC0_IMAP0_2 0x0C08
0085 #define BCMA_CORE_PCIE2_FUNC0_IMAP0_3 0x0C0C
0086 #define BCMA_CORE_PCIE2_FUNC0_IMAP0_4 0x0C10
0087 #define BCMA_CORE_PCIE2_FUNC0_IMAP0_5 0x0C14
0088 #define BCMA_CORE_PCIE2_FUNC0_IMAP0_6 0x0C18
0089 #define BCMA_CORE_PCIE2_FUNC0_IMAP0_7 0x0C1C
0090 #define BCMA_CORE_PCIE2_FUNC1_IMAP0_0 0x0C20
0091 #define BCMA_CORE_PCIE2_FUNC1_IMAP0_1 0x0C24
0092 #define BCMA_CORE_PCIE2_FUNC1_IMAP0_2 0x0C28
0093 #define BCMA_CORE_PCIE2_FUNC1_IMAP0_3 0x0C2C
0094 #define BCMA_CORE_PCIE2_FUNC1_IMAP0_4 0x0C30
0095 #define BCMA_CORE_PCIE2_FUNC1_IMAP0_5 0x0C34
0096 #define BCMA_CORE_PCIE2_FUNC1_IMAP0_6 0x0C38
0097 #define BCMA_CORE_PCIE2_FUNC1_IMAP0_7 0x0C3C
0098 #define BCMA_CORE_PCIE2_FUNC0_IMAP1 0x0C80
0099 #define BCMA_CORE_PCIE2_FUNC1_IMAP1 0x0C88
0100 #define BCMA_CORE_PCIE2_FUNC0_IMAP2 0x0CC0
0101 #define BCMA_CORE_PCIE2_FUNC1_IMAP2 0x0CC8
0102 #define BCMA_CORE_PCIE2_IARR0_LOWER 0x0D00
0103 #define BCMA_CORE_PCIE2_IARR0_UPPER 0x0D04
0104 #define BCMA_CORE_PCIE2_IARR1_LOWER 0x0D08
0105 #define BCMA_CORE_PCIE2_IARR1_UPPER 0x0D0C
0106 #define BCMA_CORE_PCIE2_IARR2_LOWER 0x0D10
0107 #define BCMA_CORE_PCIE2_IARR2_UPPER 0x0D14
0108 #define BCMA_CORE_PCIE2_OARR0 0x0D20
0109 #define BCMA_CORE_PCIE2_OARR1 0x0D28
0110 #define BCMA_CORE_PCIE2_OARR2 0x0D30
0111 #define BCMA_CORE_PCIE2_OMAP0_LOWER 0x0D40
0112 #define BCMA_CORE_PCIE2_OMAP0_UPPER 0x0D44
0113 #define BCMA_CORE_PCIE2_OMAP1_LOWER 0x0D48
0114 #define BCMA_CORE_PCIE2_OMAP1_UPPER 0x0D4C
0115 #define BCMA_CORE_PCIE2_OMAP2_LOWER 0x0D50
0116 #define BCMA_CORE_PCIE2_OMAP2_UPPER 0x0D54
0117 #define BCMA_CORE_PCIE2_FUNC1_IARR1_SIZE 0x0D58
0118 #define BCMA_CORE_PCIE2_FUNC1_IARR2_SIZE 0x0D5C
0119 #define BCMA_CORE_PCIE2_MEM_CONTROL 0x0F00
0120 #define BCMA_CORE_PCIE2_MEM_ECC_ERRLOG0 0x0F04
0121 #define BCMA_CORE_PCIE2_MEM_ECC_ERRLOG1 0x0F08
0122 #define BCMA_CORE_PCIE2_LINK_STATUS 0x0F0C
0123 #define BCMA_CORE_PCIE2_STRAP_STATUS 0x0F10
0124 #define BCMA_CORE_PCIE2_RESET_STATUS 0x0F14
0125 #define BCMA_CORE_PCIE2_RESETEN_IN_LINKDOWN 0x0F18
0126 #define BCMA_CORE_PCIE2_MISC_INTR_EN 0x0F1C
0127 #define BCMA_CORE_PCIE2_TX_DEBUG_CFG 0x0F20
0128 #define BCMA_CORE_PCIE2_MISC_CONFIG 0x0F24
0129 #define BCMA_CORE_PCIE2_MISC_STATUS 0x0F28
0130 #define BCMA_CORE_PCIE2_INTR_EN 0x0F30
0131 #define BCMA_CORE_PCIE2_INTR_CLEAR 0x0F34
0132 #define BCMA_CORE_PCIE2_INTR_STATUS 0x0F38
0133
0134
0135 #define PCIE2_INTSTATUS 0x090
0136 #define PCIE2_INTMASK 0x094
0137 #define PCIE2_SBMBX 0x098
0138
0139 #define PCIE2_PMCR_REFUP 0x1814
0140
0141 #define PCIE2_CAP_DEVSTSCTRL2_OFFSET 0xD4
0142 #define PCIE2_CAP_DEVSTSCTRL2_LTRENAB 0x400
0143 #define PCIE2_PVT_REG_PM_CLK_PERIOD 0x184c
0144
0145 struct bcma_drv_pcie2 {
0146 struct bcma_device *core;
0147
0148 u16 reqsize;
0149 };
0150
0151 #define pcie2_read16(pcie2, offset) bcma_read16((pcie2)->core, offset)
0152 #define pcie2_read32(pcie2, offset) bcma_read32((pcie2)->core, offset)
0153 #define pcie2_write16(pcie2, offset, val) bcma_write16((pcie2)->core, offset, val)
0154 #define pcie2_write32(pcie2, offset, val) bcma_write32((pcie2)->core, offset, val)
0155
0156 #define pcie2_set32(pcie2, offset, set) bcma_set32((pcie2)->core, offset, set)
0157 #define pcie2_mask32(pcie2, offset, mask) bcma_mask32((pcie2)->core, offset, mask)
0158
0159 #endif