aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Lin <shawn.lin@rock-chips.com>2016-12-07 16:05:59 -0500
committerBjorn Helgaas <bhelgaas@google.com>2016-12-07 16:05:59 -0500
commit77bc68cf17973ee81e1cbc21d634c99aa8dca014 (patch)
treeb9f6f2f608533148be2d0535bf3dc2614a92ce41
parentf2fb5b8f2a0cb67ba4535eb08d9cfb301ac92429 (diff)
PCI: rockchip: Remove the pointer to L1 substate cap
Per the errata of TRM, the RC can't support L1 substate, so remove the L1 substate cap as well as operation for PCIE_RC_CONFIG_L1_SUBSTATE_CTRL2. Tested-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r--drivers/pci/host/pcie-rockchip.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
index 13e0dd6097a4..17df584742ff 100644
--- a/drivers/pci/host/pcie-rockchip.c
+++ b/drivers/pci/host/pcie-rockchip.c
@@ -148,6 +148,8 @@
148#define PCIE_RC_CONFIG_LCS_LBMS BIT(30) 148#define PCIE_RC_CONFIG_LCS_LBMS BIT(30)
149#define PCIE_RC_CONFIG_LCS_LAMS BIT(31) 149#define PCIE_RC_CONFIG_LCS_LAMS BIT(31)
150#define PCIE_RC_CONFIG_L1_SUBSTATE_CTRL2 (PCIE_RC_CONFIG_BASE + 0x90c) 150#define PCIE_RC_CONFIG_L1_SUBSTATE_CTRL2 (PCIE_RC_CONFIG_BASE + 0x90c)
151#define PCIE_RC_CONFIG_THP_CAP (PCIE_RC_CONFIG_BASE + 0x274)
152#define PCIE_RC_CONFIG_THP_CAP_NEXT_MASK GENMASK(31, 20)
151 153
152#define PCIE_CORE_AXI_CONF_BASE 0xc00000 154#define PCIE_CORE_AXI_CONF_BASE 0xc00000
153#define PCIE_CORE_OB_REGION_ADDR0 (PCIE_CORE_AXI_CONF_BASE + 0x0) 155#define PCIE_CORE_OB_REGION_ADDR0 (PCIE_CORE_AXI_CONF_BASE + 0x0)
@@ -569,15 +571,6 @@ static int rockchip_pcie_init_port(struct rockchip_pcie *rockchip)
569 return err; 571 return err;
570 } 572 }
571 573
572 /*
573 * We need to read/write PCIE_RC_CONFIG_L1_SUBSTATE_CTRL2 before
574 * enabling ASPM. Otherwise L1PwrOnSc and L1PwrOnVal isn't
575 * reliable and enabling ASPM doesn't work. This is a controller
576 * bug we need to work around.
577 */
578 status = rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_L1_SUBSTATE_CTRL2);
579 rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_L1_SUBSTATE_CTRL2);
580
581 /* Fix the transmitted FTS count desired to exit from L0s. */ 574 /* Fix the transmitted FTS count desired to exit from L0s. */
582 status = rockchip_pcie_read(rockchip, PCIE_CORE_CTRL_PLC1); 575 status = rockchip_pcie_read(rockchip, PCIE_CORE_CTRL_PLC1);
583 status = (status & PCIE_CORE_CTRL_PLC1_FTS_MASK) | 576 status = (status & PCIE_CORE_CTRL_PLC1_FTS_MASK) |
@@ -655,6 +648,12 @@ static int rockchip_pcie_init_port(struct rockchip_pcie *rockchip)
655 rockchip_pcie_write(rockchip, 648 rockchip_pcie_write(rockchip,
656 PCI_CLASS_BRIDGE_PCI << PCIE_RC_CONFIG_SCC_SHIFT, 649 PCI_CLASS_BRIDGE_PCI << PCIE_RC_CONFIG_SCC_SHIFT,
657 PCIE_RC_CONFIG_RID_CCR); 650 PCIE_RC_CONFIG_RID_CCR);
651
652 /* Clear THP cap's next cap pointer to remove L1 substate cap */
653 status = rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_THP_CAP);
654 status &= ~PCIE_RC_CONFIG_THP_CAP_NEXT_MASK;
655 rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_THP_CAP);
656
658 rockchip_pcie_write(rockchip, 0x0, PCIE_RC_BAR_CONF); 657 rockchip_pcie_write(rockchip, 0x0, PCIE_RC_BAR_CONF);
659 658
660 rockchip_pcie_write(rockchip, 659 rockchip_pcie_write(rockchip,