0075-v6.0-PCI-qcom-Define-slot-capabilities-using-PCI_EXP_SLTC.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. From d568739f1c21e1768a887ff85611769f782eb64f Mon Sep 17 00:00:00 2001
  2. From: Baruch Siach <[email protected]>
  3. Date: Tue, 21 Jun 2022 11:54:53 +0300
  4. Subject: [PATCH] PCI: qcom: Define slot capabilities using PCI_EXP_SLTCAP_*
  5. The PCIE_CAP_LINK1_VAL macro actually defines slot capabilities. Use
  6. PCI_EXP_SLTCAP_* macros to spell its value, and rename it to better
  7. describe its meaning.
  8. Link: https://lore.kernel.org/r/3025d5e1d8da64798db6958f9780c4763fbcac47.1655799816.git.baruch@tkos.co.il
  9. Signed-off-by: Baruch Siach <[email protected]>
  10. Signed-off-by: Bjorn Helgaas <[email protected]>
  11. Reviewed-by: Rob Herring <[email protected]>
  12. Acked-by: Stanimir Varbanov <[email protected]>
  13. ---
  14. drivers/pci/controller/dwc/pcie-qcom.c | 17 +++++++++++++++--
  15. 1 file changed, 15 insertions(+), 2 deletions(-)
  16. --- a/drivers/pci/controller/dwc/pcie-qcom.c
  17. +++ b/drivers/pci/controller/dwc/pcie-qcom.c
  18. @@ -69,7 +69,20 @@
  19. #define PCIE20_AXI_MSTR_RESP_COMP_CTRL1 0x81c
  20. #define CFG_BRIDGE_SB_INIT BIT(0)
  21. -#define PCIE_CAP_LINK1_VAL 0x2FD7F
  22. +#define PCIE_CAP_SLOT_POWER_LIMIT_VAL FIELD_PREP(PCI_EXP_SLTCAP_SPLV, \
  23. + 250)
  24. +#define PCIE_CAP_SLOT_POWER_LIMIT_SCALE FIELD_PREP(PCI_EXP_SLTCAP_SPLS, \
  25. + 1)
  26. +#define PCIE_CAP_SLOT_VAL (PCI_EXP_SLTCAP_ABP | \
  27. + PCI_EXP_SLTCAP_PCP | \
  28. + PCI_EXP_SLTCAP_MRLSP | \
  29. + PCI_EXP_SLTCAP_AIP | \
  30. + PCI_EXP_SLTCAP_PIP | \
  31. + PCI_EXP_SLTCAP_HPS | \
  32. + PCI_EXP_SLTCAP_HPC | \
  33. + PCI_EXP_SLTCAP_EIP | \
  34. + PCIE_CAP_SLOT_POWER_LIMIT_VAL | \
  35. + PCIE_CAP_SLOT_POWER_LIMIT_SCALE)
  36. #define PCIE20_PARF_Q2A_FLUSH 0x1AC
  37. @@ -1125,7 +1138,7 @@ static int qcom_pcie_post_init_2_3_3(str
  38. writel(PCI_COMMAND_MASTER, pci->dbi_base + PCI_COMMAND);
  39. writel(DBI_RO_WR_EN, pci->dbi_base + PCIE20_MISC_CONTROL_1_REG);
  40. - writel(PCIE_CAP_LINK1_VAL, pci->dbi_base + offset + PCI_EXP_SLTCAP);
  41. + writel(PCIE_CAP_SLOT_VAL, pci->dbi_base + offset + PCI_EXP_SLTCAP);
  42. val = readl(pci->dbi_base + offset + PCI_EXP_LNKCAP);
  43. val &= ~PCI_EXP_LNKCAP_ASPMS;