diff options
author | Stephen Warren <swarren@nvidia.com> | 2013-08-09 10:49:25 -0400 |
---|---|---|
committer | Stephen Warren <swarren@nvidia.com> | 2013-08-13 14:07:50 -0400 |
commit | b02b07adb159166f57d5e66e67ab1ae9de254229 (patch) | |
tree | ad0d00790f34d7f82d1c4e069a1c626eeaaa9da9 /drivers/pci | |
parent | 94716cddbec6602643e2c7fe10f4385d951cf2f8 (diff) |
PCI: tegra: set up PADS_REFCLK_CFG1
The registers PADS_REFCLK_CFG are an array of 16-bit data, one entry per
PCIe root port. For Tegra30, we therefore need to write a 3rd entry in
this array. Doing so makes the mini-PCIe slot on Beaver operate correctly.
While we're at it, add some #defines to partially document the fields
within these 16-bit values.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/host/pci-tegra.c | 29 |
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 | |||
198 | struct tegra_msi { | 217 | struct 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; |