aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/renesas_sdhi.h
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2020-09-02 10:18:12 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2020-09-09 13:09:44 +0200
commitce6f92c2801e90650106b00666aa37560978e324 (patch)
tree6efa2c8040f9c5a278bde4292f8ed307d4c4d565 /drivers/mmc/host/renesas_sdhi.h
parentmmc: tmio: add generic hook to fixup after a completed request (diff)
downloadlinux-dev-ce6f92c2801e90650106b00666aa37560978e324.tar.xz
linux-dev-ce6f92c2801e90650106b00666aa37560978e324.zip
mmc: renesas_sdhi: support manual calibration
Some R-Car Gen3 SoCs need some manual correction of timing parameters after the automatic tuning has finished but before next CMD13 is completed. This patch implements that by this state machine: - introducing a per-SoC correction table if needed - iff such a table exists, the 'fixup_request' callback is populated during probe - iff such a table exists, a runtime flag ('needs_adjust_hs400') is set when HS400 tuning was completed - the callback will check the runtime flag and enable the corrected manual mode if the flag is set and CMD13 is encountered - at the end of the enablement the runtime flag is cleared - iff the configuration flag is set, the manual mode will be disabled when HS400 gets downgraded There also some helper functions added to access the TMPPORT registers. The actual correction table is SoC and instance(!) specific and is added to the quirks struct. Signed-off-by: Takeshi Saito <takeshi.saito.xv@renesas.com> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/20200902081812.1591-3-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/renesas_sdhi.h')
-rw-r--r--drivers/mmc/host/renesas_sdhi.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
index 14c64caefc64..24958de274c1 100644
--- a/drivers/mmc/host/renesas_sdhi.h
+++ b/drivers/mmc/host/renesas_sdhi.h
@@ -33,10 +33,13 @@ struct renesas_sdhi_of_data {
unsigned short max_segs;
};
+#define SDHI_CALIB_TABLE_MAX 32
+
struct renesas_sdhi_quirks {
bool hs400_disabled;
bool hs400_4taps;
u32 hs400_bad_taps;
+ const u8 (*hs400_calib_table)[SDHI_CALIB_TABLE_MAX];
};
struct tmio_mmc_dma {
@@ -58,6 +61,8 @@ struct renesas_sdhi {
void __iomem *scc_ctl;
u32 scc_tappos;
u32 scc_tappos_hs400;
+ const u8 *adjust_hs400_calib_table;
+ bool needs_adjust_hs400;
bool doing_tune;
/* Tuning values: 1 for success, 0 for failure */