aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/host/pci-tegra.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 75607c788ff6..ad95c406a6d0 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -195,6 +195,25 @@
195#define PADS_REFCLK_CFG0 0x000000C8 195#define PADS_REFCLK_CFG0 0x000000C8
196#define PADS_REFCLK_CFG1 0x000000CC 196#define PADS_REFCLK_CFG1 0x000000CC
197 197
198/*
199 * Fields in PADS_REFCLK_CFG*. Those registers form an array of 16-bit
200 * entries, one entry per PCIe port. These field definitions and desired
201 * values aren't in the TRM, but do come from NVIDIA.
202 */
203#define PADS_REFCLK_CFG_TERM_SHIFT 2 /* 6:2 */
204#define PADS_REFCLK_CFG_E_TERM_SHIFT 7
205#define PADS_REFCLK_CFG_PREDI_SHIFT 8 /* 11:8 */
206#define PADS_REFCLK_CFG_DRVI_SHIFT 12 /* 15:12 */
207
208/* Default value provided by HW engineering is 0xfa5c */
209#define PADS_REFCLK_CFG_VALUE \
210 ( \
211 (0x17 << PADS_REFCLK_CFG_TERM_SHIFT) | \
212 (0 << PADS_REFCLK_CFG_E_TERM_SHIFT) | \
213 (0xa << PADS_REFCLK_CFG_PREDI_SHIFT) | \
214 (0xf << PADS_REFCLK_CFG_DRVI_SHIFT) \
215 )
216
198struct tegra_msi { 217struct tegra_msi {
199 struct msi_chip chip; 218 struct msi_chip chip;
200 DECLARE_BITMAP(used, INT_PCI_MSI_NR); 219 DECLARE_BITMAP(used, INT_PCI_MSI_NR);
@@ -808,11 +827,11 @@ static int tegra_pcie_enable_controller(struct tegra_pcie *pcie)
808 value |= PADS_PLL_CTL_RST_B4SM; 827 value |= PADS_PLL_CTL_RST_B4SM;
809 pads_writel(pcie, value, soc->pads_pll_ctl); 828 pads_writel(pcie, value, soc->pads_pll_ctl);
810 829
811 /* 830 /* Configure the reference clock driver */
812 * Hack, set the clock voltage to the DEFAULT provided by hw folks. 831 value = PADS_REFCLK_CFG_VALUE | (PADS_REFCLK_CFG_VALUE << 16);
813 * This doesn't exist in the documentation. 832 pads_writel(pcie, value, PADS_REFCLK_CFG0);
814 */ 833 if (soc->num_ports > 2)
815 pads_writel(pcie, 0xfa5cfa5c, PADS_REFCLK_CFG0); 834 pads_writel(pcie, PADS_REFCLK_CFG_VALUE, PADS_REFCLK_CFG1);
816 835
817 /* wait for the PLL to lock */ 836 /* wait for the PLL to lock */
818 timeout = 300; 837 timeout = 300;