1 From 994818d7302f5e26644f6571183455da1d95e742 Mon Sep 17 00:00:00 2001
2 From: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
3 Date: Tue, 13 Feb 2024 17:09:47 +0000
4 Subject: [PATCH 0895/1085] PCI: brcmstb: Set new flags to avoid QOS "holes" on
7 Set some flags present (and recommended) in 2712D0, but missing
8 (and harmless) in 2712C1. In particular, EN_QOS_UPDATE_TIMING_FIX
9 must be set to avoid spurious QOS=0 when the queue changes from
10 empty to non-empty, to make D0 match the existing C1 behaviour.
12 Not enabling "QOS forwarding", which still seems not to help.
14 Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
16 drivers/pci/controller/pcie-brcmstb.c | 7 ++++++-
17 1 file changed, 6 insertions(+), 1 deletion(-)
19 --- a/drivers/pci/controller/pcie-brcmstb.c
20 +++ b/drivers/pci/controller/pcie-brcmstb.c
22 #define VDM_PRIORITY_TO_QOS_MAP_MASK 0xf
24 #define PCIE_MISC_AXI_INTF_CTRL 0x416C
25 +#define AXI_EN_RCLK_QOS_ARRAY_FIX BIT(13)
26 +#define AXI_EN_QOS_UPDATE_TIMING_FIX BIT(12)
27 +#define AXI_DIS_QOS_GATING_IN_MASTER BIT(11)
28 #define AXI_REQFIFO_EN_QOS_PROPAGATION BIT(7)
29 #define AXI_BRIDGE_LOW_LATENCY_MODE BIT(6)
30 #define AXI_MASTER_MAX_OUTSTANDING_REQUESTS_MASK 0x3f
31 @@ -558,9 +561,11 @@ static void brcm_pcie_set_tc_qos(struct
32 if (pcie->type != BCM2712)
35 - /* XXX: BCM2712C0 is broken, disable the forwarding search */
36 + /* Disable broken QOS forwarding search. Set chicken bits for 2712D0 */
37 reg = readl(pcie->base + PCIE_MISC_AXI_INTF_CTRL);
38 reg &= ~AXI_REQFIFO_EN_QOS_PROPAGATION;
39 + reg |= AXI_EN_RCLK_QOS_ARRAY_FIX | AXI_EN_QOS_UPDATE_TIMING_FIX |
40 + AXI_DIS_QOS_GATING_IN_MASTER;
41 writel(reg, pcie->base + PCIE_MISC_AXI_INTF_CTRL);
43 /* Disable VDM reception by default - QoS map defaults to 0 */