Skip to content

Commit 68f5ef7

Browse files
petegriffinmartinkpetersen
authored andcommitted
scsi: ufs: exynos: Move UFS shareability value to drvdata
gs101 I/O coherency shareability bits differ from exynosauto SoC. To support both SoCs move this info the SoC drvdata. Currently both the value and mask are the same for both gs101 and exynosauto, thus we use the same value. Signed-off-by: Peter Griffin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Fixes: d11e0a3 ("scsi: ufs: exynos: Add support for Tensor gs101 SoC") Cc: [email protected] Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 3d10116 commit 68f5ef7

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

drivers/ufs/host/ufs-exynos.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,16 @@
9292
UIC_TRANSPORT_NO_CONNECTION_RX |\
9393
UIC_TRANSPORT_BAD_TC)
9494

95-
/* FSYS UFS Shareability */
96-
#define UFS_WR_SHARABLE BIT(2)
97-
#define UFS_RD_SHARABLE BIT(1)
98-
#define UFS_SHARABLE (UFS_WR_SHARABLE | UFS_RD_SHARABLE)
99-
#define UFS_SHAREABILITY_OFFSET 0x710
95+
/* UFS Shareability */
96+
#define UFS_EXYNOSAUTO_WR_SHARABLE BIT(2)
97+
#define UFS_EXYNOSAUTO_RD_SHARABLE BIT(1)
98+
#define UFS_EXYNOSAUTO_SHARABLE (UFS_EXYNOSAUTO_WR_SHARABLE | \
99+
UFS_EXYNOSAUTO_RD_SHARABLE)
100+
#define UFS_GS101_WR_SHARABLE BIT(1)
101+
#define UFS_GS101_RD_SHARABLE BIT(0)
102+
#define UFS_GS101_SHARABLE (UFS_GS101_WR_SHARABLE | \
103+
UFS_GS101_RD_SHARABLE)
104+
#define UFS_SHAREABILITY_OFFSET 0x710
100105

101106
/* Multi-host registers */
102107
#define MHCTRL 0xC4
@@ -210,7 +215,7 @@ static int exynos_ufs_shareability(struct exynos_ufs *ufs)
210215
if (ufs->sysreg) {
211216
return regmap_update_bits(ufs->sysreg,
212217
ufs->shareability_reg_offset,
213-
UFS_SHARABLE, UFS_SHARABLE);
218+
ufs->iocc_mask, ufs->iocc_mask);
214219
}
215220

216221
return 0;
@@ -1174,6 +1179,7 @@ static int exynos_ufs_parse_dt(struct device *dev, struct exynos_ufs *ufs)
11741179
}
11751180
}
11761181

1182+
ufs->iocc_mask = ufs->drv_data->iocc_mask;
11771183
ufs->pclk_avail_min = PCLK_AVAIL_MIN;
11781184
ufs->pclk_avail_max = PCLK_AVAIL_MAX;
11791185

@@ -2034,6 +2040,7 @@ static const struct exynos_ufs_drv_data exynosauto_ufs_drvs = {
20342040
.opts = EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL |
20352041
EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR |
20362042
EXYNOS_UFS_OPT_BROKEN_RX_SEL_IDX,
2043+
.iocc_mask = UFS_EXYNOSAUTO_SHARABLE,
20372044
.drv_init = exynosauto_ufs_drv_init,
20382045
.post_hce_enable = exynosauto_ufs_post_hce_enable,
20392046
.pre_link = exynosauto_ufs_pre_link,
@@ -2135,6 +2142,7 @@ static const struct exynos_ufs_drv_data gs101_ufs_drvs = {
21352142
.opts = EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR |
21362143
EXYNOS_UFS_OPT_UFSPR_SECURE |
21372144
EXYNOS_UFS_OPT_TIMER_TICK_SELECT,
2145+
.iocc_mask = UFS_GS101_SHARABLE,
21382146
.drv_init = gs101_ufs_drv_init,
21392147
.pre_link = gs101_ufs_pre_link,
21402148
.post_link = gs101_ufs_post_link,

drivers/ufs/host/ufs-exynos.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ struct exynos_ufs_drv_data {
181181
struct exynos_ufs_uic_attr *uic_attr;
182182
unsigned int quirks;
183183
unsigned int opts;
184+
u32 iocc_mask;
184185
/* SoC's specific operations */
185186
int (*drv_init)(struct exynos_ufs *ufs);
186187
int (*pre_link)(struct exynos_ufs *ufs);
@@ -231,6 +232,7 @@ struct exynos_ufs {
231232
const struct exynos_ufs_drv_data *drv_data;
232233
struct regmap *sysreg;
233234
u32 shareability_reg_offset;
235+
u32 iocc_mask;
234236

235237
u32 opts;
236238
#define EXYNOS_UFS_OPT_HAS_APB_CLK_CTRL BIT(0)

0 commit comments

Comments
 (0)