|
209 | 209 | #define PCIE_DVT_PMU_PCIE_PHY_CTRL_DAST_PWRDN_MASK 0x1
|
210 | 210 | #define PCIE_DVT_PMU_PCIE_PHY_CTRL_DAST_PWRDN_SHIFT 0x0
|
211 | 211 |
|
| 212 | +/* BCM7712/2712-specific registers */ |
| 213 | +#define PCIE_MISC_UBUS_CTRL 0x40a4 |
| 214 | +#define PCIE_MISC_UBUS_CTRL_UBUS_PCIE_REPLY_ERR_DIS_MASK BIT(13) |
| 215 | +#define PCIE_MISC_UBUS_CTRL_UBUS_PCIE_REPLY_DECERR_DIS_MASK BIT(19) |
| 216 | + |
| 217 | +#define PCIE_MISC_UBUS_TIMEOUT 0x40a8 |
| 218 | + |
| 219 | +#define PCIE_MISC_RC_CONFIG_RETRY_TIMEOUT 0x405c |
| 220 | + |
| 221 | +#define PCIE_MISC_AXI_READ_ERROR_DATA 0x4170 |
| 222 | + |
212 | 223 | /* Forward declarations */
|
213 | 224 | struct brcm_pcie;
|
214 | 225 |
|
@@ -859,6 +870,30 @@ static int brcm_pcie_post_setup_bcm2712(struct brcm_pcie *pcie)
|
859 | 870 | tmp |= 0x12;
|
860 | 871 | writel(tmp, pcie->base + PCIE_RC_PL_PHY_CTL_15);
|
861 | 872 |
|
| 873 | + /* |
| 874 | + * BCM7712/2712 uses a UBUS-AXI bridge. |
| 875 | + * Suppress AXI error responses and return 1s for read failures. |
| 876 | + */ |
| 877 | + tmp = readl(pcie->base + PCIE_MISC_UBUS_CTRL); |
| 878 | + u32p_replace_bits(&tmp, 1, PCIE_MISC_UBUS_CTRL_UBUS_PCIE_REPLY_ERR_DIS_MASK); |
| 879 | + u32p_replace_bits(&tmp, 1, PCIE_MISC_UBUS_CTRL_UBUS_PCIE_REPLY_DECERR_DIS_MASK); |
| 880 | + writel(tmp, pcie->base + PCIE_MISC_UBUS_CTRL); |
| 881 | + writel(0xffffffff, pcie->base + PCIE_MISC_AXI_READ_ERROR_DATA); |
| 882 | + |
| 883 | + /* |
| 884 | + * Adjust timeouts. The UBUS timeout also affects Configuration Request |
| 885 | + * Retry responses, as the request will get terminated if |
| 886 | + * either timeout expires, so both have to be a large value |
| 887 | + * (in clocks of 750MHz). |
| 888 | + * Set UBUS timeout to 250ms, then set RC config retry timeout |
| 889 | + * to be ~240ms. |
| 890 | + * |
| 891 | + * If CRSSVE=1 this will stop the core from blocking on a Retry |
| 892 | + * response, but does require the device to be well-behaved... |
| 893 | + */ |
| 894 | + writel(0xB2D0000, pcie->base + PCIE_MISC_UBUS_TIMEOUT); |
| 895 | + writel(0xABA0000, pcie->base + PCIE_MISC_RC_CONFIG_RETRY_TIMEOUT); |
| 896 | + |
862 | 897 | return 0;
|
863 | 898 | }
|
864 | 899 |
|
|
0 commit comments