summaryrefslogtreecommitdiffstats
path: root/drivers/phy
diff options
context:
space:
mode:
authorManikanta Maddireddy <mmaddireddy@nvidia.com>2018-02-12 04:59:03 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-02-13 11:36:57 -0500
commita4bc1ad60d1677cd28a726acbbdcc53b8632f38d (patch)
tree3beb24ab0faea2f4e72e1e3eecbc619ba4b9126c /drivers/phy
parent1d8e16b4f2df50af0bbf626e8d08d3e87fe84556 (diff)
phy: tegra: pcie: Enale P2U intr based on DT prop
One of the lane margining test requirements is to disable ASPM states. P2U registers are not accessible when link is in L1SS state. If driver enables P2U interrupts, P2U isr cannot read INT status when link is in L1SS. Enable P2U interrupts based on nvidia,enable-lm DT property to avoid this issue. Enable nvidia,enable-lm when lane margining test is planned. bug 200385039 Change-Id: I98b998799aac89809c8debaadbf5baeb27a0a657 Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1655840 Reviewed-by: Vidya Sagar <vidyas@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/phy-tegra-p2u.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/phy/phy-tegra-p2u.c b/drivers/phy/phy-tegra-p2u.c
index cfdd4c829..08d3b07de 100644
--- a/drivers/phy/phy-tegra-p2u.c
+++ b/drivers/phy/phy-tegra-p2u.c
@@ -76,6 +76,7 @@ struct tegra_p2u {
76 struct work_struct rx_margin_work; 76 struct work_struct rx_margin_work;
77 u32 next_state; 77 u32 next_state;
78 spinlock_t next_state_lock; /* lock for next_state */ 78 spinlock_t next_state_lock; /* lock for next_state */
79 bool enable_lm;
79}; 80};
80 81
81struct margin_ctrl { 82struct margin_ctrl {
@@ -96,11 +97,13 @@ static int tegra_p2u_power_on(struct phy *x)
96 u32 val; 97 u32 val;
97 struct tegra_p2u *phy = phy_get_drvdata(x); 98 struct tegra_p2u *phy = phy_get_drvdata(x);
98 99
99 val = P2U_RX_MARGIN_SW_INT_EN_READINESS | 100 if (phy->enable_lm) {
100 P2U_RX_MARGIN_SW_INT_EN_MARGIN_START | 101 val = P2U_RX_MARGIN_SW_INT_EN_READINESS |
101 P2U_RX_MARGIN_SW_INT_EN_MARGIN_CHANGE | 102 P2U_RX_MARGIN_SW_INT_EN_MARGIN_START |
102 P2U_RX_MARGIN_SW_INT_EN_MARGIN_STOP; 103 P2U_RX_MARGIN_SW_INT_EN_MARGIN_CHANGE |
103 writel(val, phy->base + P2U_RX_MARGIN_SW_INT_EN); 104 P2U_RX_MARGIN_SW_INT_EN_MARGIN_STOP;
105 writel(val, phy->base + P2U_RX_MARGIN_SW_INT_EN);
106 }
104 107
105 val = readl(phy->base + P2U_PERIODIC_EQ_CTRL_GEN3); 108 val = readl(phy->base + P2U_PERIODIC_EQ_CTRL_GEN3);
106 val |= P2U_PERIODIC_EQ_CTRL_GEN3_INIT_PRESET_EQ_TRAIN_EN; 109 val |= P2U_PERIODIC_EQ_CTRL_GEN3_INIT_PRESET_EQ_TRAIN_EN;
@@ -335,6 +338,9 @@ static int tegra_p2u_probe(struct platform_device *pdev)
335 } 338 }
336 phy->id = val; 339 phy->id = val;
337 340
341 phy->enable_lm = of_property_read_bool(dev->of_node,
342 "nvidia,enable-lm");
343
338 spin_lock_init(&phy->next_state_lock); 344 spin_lock_init(&phy->next_state_lock);
339 INIT_WORK(&phy->rx_margin_work, rx_margin_work_fn); 345 INIT_WORK(&phy->rx_margin_work, rx_margin_work_fn);
340 346