diff options
author | Mikko Perttunen <mperttunen@nvidia.com> | 2014-08-26 05:00:30 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-08-26 10:48:27 -0400 |
commit | e327f11543f21061e10c8db6e812396ba930a972 (patch) | |
tree | 38b0f8a972f4e34cc61d36048dd678310bf75b50 /drivers/ata/ahci_tegra.c | |
parent | 2a13772a144d2956a7fedd18685921d0a9b8b783 (diff) |
ata: ahci_tegra: Read calibration fuse
The original version of the driver did not read the SATA calibration
fuse to remove the dependency to the fuse driver. The fuse driver
is now merged, so add this functionality.
The calibration fuse contains a 2-bit value used to pick a set
of calibration values for the SATA pad.
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata/ahci_tegra.c')
-rw-r--r-- | drivers/ata/ahci_tegra.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/ata/ahci_tegra.c b/drivers/ata/ahci_tegra.c index f1fef74e503c..032904402c95 100644 --- a/drivers/ata/ahci_tegra.c +++ b/drivers/ata/ahci_tegra.c | |||
@@ -18,14 +18,17 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <linux/ahci_platform.h> | 20 | #include <linux/ahci_platform.h> |
21 | #include <linux/reset.h> | ||
22 | #include <linux/errno.h> | 21 | #include <linux/errno.h> |
23 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
24 | #include <linux/module.h> | 23 | #include <linux/module.h> |
25 | #include <linux/of_device.h> | 24 | #include <linux/of_device.h> |
26 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
27 | #include <linux/regulator/consumer.h> | 26 | #include <linux/regulator/consumer.h> |
27 | #include <linux/reset.h> | ||
28 | |||
29 | #include <soc/tegra/fuse.h> | ||
28 | #include <soc/tegra/pmc.h> | 30 | #include <soc/tegra/pmc.h> |
31 | |||
29 | #include "ahci.h" | 32 | #include "ahci.h" |
30 | 33 | ||
31 | #define SATA_CONFIGURATION_0 0x180 | 34 | #define SATA_CONFIGURATION_0 0x180 |
@@ -180,9 +183,12 @@ static int tegra_ahci_controller_init(struct ahci_host_priv *hpriv) | |||
180 | 183 | ||
181 | /* Pad calibration */ | 184 | /* Pad calibration */ |
182 | 185 | ||
183 | /* FIXME Always use calibration 0. Change this to read the calibration | 186 | ret = tegra_fuse_readl(FUSE_SATA_CALIB, &val); |
184 | * fuse once the fuse driver has landed. */ | 187 | if (ret) { |
185 | val = 0; | 188 | dev_err(&tegra->pdev->dev, |
189 | "failed to read calibration fuse: %d\n", ret); | ||
190 | return ret; | ||
191 | } | ||
186 | 192 | ||
187 | calib = tegra124_pad_calibration[val & FUSE_SATA_CALIB_MASK]; | 193 | calib = tegra124_pad_calibration[val & FUSE_SATA_CALIB_MASK]; |
188 | 194 | ||