diff options
author | Shawn Lin <shawn.lin@rock-chips.com> | 2016-12-07 16:06:00 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2016-12-07 16:06:00 -0500 |
commit | f37500b8aac47b436fe3fe3e63b7169f8eff190d (patch) | |
tree | 357923e8f8bfb90d500ca9c0dfd9641ab0511a7a | |
parent | a45e2611b9bbd81288d97d02ce7e74a60a698d43 (diff) |
PCI: rockchip: Clean up bit definitions for PCIE_RC_CONFIG_LCS
PCIE_RC_CONFIG_LCS contains control and status bits specific to the PCIe
link. The layout for this register looks the same as the existing
PCI_EXP_LNKCTL and PCI_EXP_LNKSTA. So let's reuse them.
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.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c index 5ff2f698e03a..989642761877 100644 --- a/drivers/pci/host/pcie-rockchip.c +++ b/drivers/pci/host/pcie-rockchip.c | |||
@@ -141,12 +141,6 @@ | |||
141 | #define PCIE_RC_CONFIG_DCR_CSPL_LIMIT 0xff | 141 | #define PCIE_RC_CONFIG_DCR_CSPL_LIMIT 0xff |
142 | #define PCIE_RC_CONFIG_DCR_CPLS_SHIFT 26 | 142 | #define PCIE_RC_CONFIG_DCR_CPLS_SHIFT 26 |
143 | #define PCIE_RC_CONFIG_LCS (PCIE_RC_CONFIG_BASE + 0xd0) | 143 | #define PCIE_RC_CONFIG_LCS (PCIE_RC_CONFIG_BASE + 0xd0) |
144 | #define PCIE_RC_CONFIG_LCS_RETRAIN_LINK BIT(5) | ||
145 | #define PCIE_RC_CONFIG_LCS_CCC BIT(6) | ||
146 | #define PCIE_RC_CONFIG_LCS_LBMIE BIT(10) | ||
147 | #define PCIE_RC_CONFIG_LCS_LABIE BIT(11) | ||
148 | #define PCIE_RC_CONFIG_LCS_LBMS BIT(30) | ||
149 | #define PCIE_RC_CONFIG_LCS_LAMS BIT(31) | ||
150 | #define PCIE_RC_CONFIG_L1_SUBSTATE_CTRL2 (PCIE_RC_CONFIG_BASE + 0x90c) | 144 | #define PCIE_RC_CONFIG_L1_SUBSTATE_CTRL2 (PCIE_RC_CONFIG_BASE + 0x90c) |
151 | #define PCIE_RC_CONFIG_THP_CAP (PCIE_RC_CONFIG_BASE + 0x274) | 145 | #define PCIE_RC_CONFIG_THP_CAP (PCIE_RC_CONFIG_BASE + 0x274) |
152 | #define PCIE_RC_CONFIG_THP_CAP_NEXT_MASK GENMASK(31, 20) | 146 | #define PCIE_RC_CONFIG_THP_CAP_NEXT_MASK GENMASK(31, 20) |
@@ -232,7 +226,7 @@ static void rockchip_pcie_enable_bw_int(struct rockchip_pcie *rockchip) | |||
232 | u32 status; | 226 | u32 status; |
233 | 227 | ||
234 | status = rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_LCS); | 228 | status = rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_LCS); |
235 | status |= (PCIE_RC_CONFIG_LCS_LBMIE | PCIE_RC_CONFIG_LCS_LABIE); | 229 | status |= (PCI_EXP_LNKCTL_LBMIE | PCI_EXP_LNKCTL_LABIE); |
236 | rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_LCS); | 230 | rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_LCS); |
237 | } | 231 | } |
238 | 232 | ||
@@ -241,7 +235,7 @@ static void rockchip_pcie_clr_bw_int(struct rockchip_pcie *rockchip) | |||
241 | u32 status; | 235 | u32 status; |
242 | 236 | ||
243 | status = rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_LCS); | 237 | status = rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_LCS); |
244 | status |= (PCIE_RC_CONFIG_LCS_LBMS | PCIE_RC_CONFIG_LCS_LAMS); | 238 | status |= (PCI_EXP_LNKSTA_LBMS | PCI_EXP_LNKSTA_LABS) << 16; |
245 | rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_LCS); | 239 | rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_LCS); |
246 | } | 240 | } |
247 | 241 | ||
@@ -581,7 +575,7 @@ static int rockchip_pcie_init_port(struct rockchip_pcie *rockchip) | |||
581 | 575 | ||
582 | /* Set RC's clock architecture as common clock */ | 576 | /* Set RC's clock architecture as common clock */ |
583 | status = rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_LCS); | 577 | status = rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_LCS); |
584 | status |= PCIE_RC_CONFIG_LCS_CCC; | 578 | status |= PCI_EXP_LNKCTL_CCC; |
585 | rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_LCS); | 579 | rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_LCS); |
586 | 580 | ||
587 | /* Enable Gen1 training */ | 581 | /* Enable Gen1 training */ |
@@ -616,7 +610,7 @@ static int rockchip_pcie_init_port(struct rockchip_pcie *rockchip) | |||
616 | * gen1 finished. | 610 | * gen1 finished. |
617 | */ | 611 | */ |
618 | status = rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_LCS); | 612 | status = rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_LCS); |
619 | status |= PCIE_RC_CONFIG_LCS_RETRAIN_LINK; | 613 | status |= PCI_EXP_LNKCTL_RL; |
620 | rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_LCS); | 614 | rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_LCS); |
621 | 615 | ||
622 | timeout = jiffies + msecs_to_jiffies(500); | 616 | timeout = jiffies + msecs_to_jiffies(500); |