aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorShawn Lin <shawn.lin@rock-chips.com>2016-12-07 16:05:58 -0500
committerBjorn Helgaas <bhelgaas@google.com>2016-12-07 16:05:58 -0500
commitb8ab8e041cc0356323c1e4aee8047ea479650340 (patch)
treeea3ee0e51fb9849440427e86196eb42d58738e4c /drivers/pci
parent4816c4c7b82b55bb46cb9b85ef8e6780fc618592 (diff)
PCI: rockchip: Mark RC as common clock architecture
The default value of common clock configuration is zero indicating Rockchip's RC is using asynchronous clock architecture but actually we are using common clock. This will confuse some EP drivers if they need some different settings referring to this value. Set the Common Clock Configuration bit in the Link Control Register. Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/host/pcie-rockchip.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
index 36f5eeb530f5..b296808ccc71 100644
--- a/drivers/pci/host/pcie-rockchip.c
+++ b/drivers/pci/host/pcie-rockchip.c
@@ -141,6 +141,7 @@
141#define PCIE_RC_CONFIG_DCR_CPLS_SHIFT 26 141#define PCIE_RC_CONFIG_DCR_CPLS_SHIFT 26
142#define PCIE_RC_CONFIG_LCS (PCIE_RC_CONFIG_BASE + 0xd0) 142#define PCIE_RC_CONFIG_LCS (PCIE_RC_CONFIG_BASE + 0xd0)
143#define PCIE_RC_CONFIG_LCS_RETRAIN_LINK BIT(5) 143#define PCIE_RC_CONFIG_LCS_RETRAIN_LINK BIT(5)
144#define PCIE_RC_CONFIG_LCS_CCC BIT(6)
144#define PCIE_RC_CONFIG_LCS_LBMIE BIT(10) 145#define PCIE_RC_CONFIG_LCS_LBMIE BIT(10)
145#define PCIE_RC_CONFIG_LCS_LABIE BIT(11) 146#define PCIE_RC_CONFIG_LCS_LABIE BIT(11)
146#define PCIE_RC_CONFIG_LCS_LBMS BIT(30) 147#define PCIE_RC_CONFIG_LCS_LBMS BIT(30)
@@ -577,6 +578,11 @@ static int rockchip_pcie_init_port(struct rockchip_pcie *rockchip)
577 578
578 rockchip_pcie_set_power_limit(rockchip); 579 rockchip_pcie_set_power_limit(rockchip);
579 580
581 /* Set RC's clock architecture as common clock */
582 status = rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_LCS);
583 status |= PCIE_RC_CONFIG_LCS_CCC;
584 rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_LCS);
585
580 /* Enable Gen1 training */ 586 /* Enable Gen1 training */
581 rockchip_pcie_write(rockchip, PCIE_CLIENT_LINK_TRAIN_ENABLE, 587 rockchip_pcie_write(rockchip, PCIE_CLIENT_LINK_TRAIN_ENABLE,
582 PCIE_CLIENT_CONFIG); 588 PCIE_CLIENT_CONFIG);