hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/mmc/host/renesas_sdhi.h
....@@ -1,12 +1,9 @@
1
+/* SPDX-License-Identifier: GPL-2.0 */
12 /*
23 * Renesas Mobile SDHI
34 *
45 * Copyright (C) 2017 Horms Solutions Ltd., Simon Horman
5
- * Copyright (C) 2017 Renesas Electronics Corporation
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
6
+ * Copyright (C) 2017-19 Renesas Electronics Corporation
107 */
118
129 #ifndef RENESAS_SDHI_H
....@@ -17,7 +14,8 @@
1714
1815 struct renesas_sdhi_scc {
1916 unsigned long clk_rate; /* clock rate for SDR104 */
20
- u32 tap; /* sampling clock position for SDR104 */
17
+ u32 tap; /* sampling clock position for SDR104/HS400 (8 TAP) */
18
+ u32 tap_hs400_4tap; /* sampling clock position for HS400 (4 TAP) */
2119 };
2220
2321 struct renesas_sdhi_of_data {
....@@ -35,6 +33,15 @@
3533 unsigned short max_segs;
3634 };
3735
36
+#define SDHI_CALIB_TABLE_MAX 32
37
+
38
+struct renesas_sdhi_quirks {
39
+ bool hs400_disabled;
40
+ bool hs400_4taps;
41
+ u32 hs400_bad_taps;
42
+ const u8 (*hs400_calib_table)[SDHI_CALIB_TABLE_MAX];
43
+};
44
+
3845 struct tmio_mmc_dma {
3946 enum dma_slave_buswidth dma_buswidth;
4047 bool (*filter)(struct dma_chan *chan, void *arg);
....@@ -48,10 +55,21 @@
4855 struct clk *clk_cd;
4956 struct tmio_mmc_data mmc_data;
5057 struct tmio_mmc_dma dma_priv;
58
+ const struct renesas_sdhi_quirks *quirks;
5159 struct pinctrl *pinctrl;
5260 struct pinctrl_state *pins_default, *pins_uhs;
5361 void __iomem *scc_ctl;
5462 u32 scc_tappos;
63
+ u32 scc_tappos_hs400;
64
+ const u8 *adjust_hs400_calib_table;
65
+ bool needs_adjust_hs400;
66
+
67
+ /* Tuning values: 1 for success, 0 for failure */
68
+ DECLARE_BITMAP(taps, BITS_PER_LONG);
69
+ /* Sampling data comparison: 1 for match, 0 for mismatch */
70
+ DECLARE_BITMAP(smpcmp, BITS_PER_LONG);
71
+ unsigned int tap_num;
72
+ unsigned int tap_set;
5573 };
5674
5775 #define host_to_priv(host) \