Skip to content

Commit fadca86

Browse files
P33Mpopcornmix
authored andcommitted
PCI: brcmstb: don't use ASPM state defines for register bits
In commit b478e16 ("PCI/ASPM: Consolidate link state defines") PCIE_LINK_STATE_L1 and PCIE_LINK_STATE_L0s grew some bits for more granular control of ASPM. This broke the aspm-no-l0s override, instead disabling link ASPM completely if this DT property was specified. Specify the field bits in the driver. Fixes: caab002 ("PCI: brcmstb: Disable L0s component of ASPM if requested") Fixes: 0693b42 ("PCI: brcmstb: Split post-link up initialization to brcm_pcie_start_link()") Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
1 parent 8ed07e9 commit fadca86

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/pci/controller/pcie-brcmstb.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747

4848
#define PCIE_RC_CFG_PRIV1_LINK_CAPABILITY 0x04dc
4949
#define PCIE_RC_CFG_PRIV1_LINK_CAPABILITY_ASPM_SUPPORT_MASK 0xc00
50+
#define PCIE_RC_CFG_PRIV1_LINK_CAPABILITY_ASPM_SUPPORT_L0S 0x1
51+
#define PCIE_RC_CFG_PRIV1_LINK_CAPABILITY_ASPM_SUPPORT_L1 0x2
52+
#define PCIE_RC_CFG_PRIV1_LINK_CAPABILITY_MAX_LINK_SPEED_MASK 0xf
5053

5154
#define PCIE_RC_CFG_PRIV1_ROOT_CAP 0x4f8
5255
#define PCIE_RC_CFG_PRIV1_ROOT_CAP_L1SS_MODE_MASK 0xf8
@@ -1205,10 +1208,11 @@ static int brcm_pcie_setup(struct brcm_pcie *pcie)
12051208
pcie->msi_target_addr = BRCM_MSI_TARGET_ADDR_GT_4GB;
12061209

12071210

1208-
/* Don't advertise L0s capability if 'aspm-no-l0s' */
1209-
aspm_support = PCIE_LINK_STATE_L1;
1211+
/* Always advertise L1 capability */
1212+
aspm_support = PCIE_RC_CFG_PRIV1_LINK_CAPABILITY_ASPM_SUPPORT_L1;
1213+
/* Advertise L0s capability unless 'aspm-no-l0s' is set */
12101214
if (!of_property_read_bool(pcie->np, "aspm-no-l0s"))
1211-
aspm_support |= PCIE_LINK_STATE_L0S;
1215+
aspm_support |= PCIE_RC_CFG_PRIV1_LINK_CAPABILITY_ASPM_SUPPORT_L0S;
12121216
tmp = readl(base + PCIE_RC_CFG_PRIV1_LINK_CAPABILITY);
12131217
u32p_replace_bits(&tmp, aspm_support,
12141218
PCIE_RC_CFG_PRIV1_LINK_CAPABILITY_ASPM_SUPPORT_MASK);

0 commit comments

Comments
 (0)