Skip to content

Commit 9238cad

Browse files
petegriffinmartinkpetersen
authored andcommitted
scsi: ufs: exynos: Add EXYNOS_UFS_OPT_TIMER_TICK_SELECT option
This option is intended to be set for SoCs that have HCI_V2P1_CTRL register and can select their tick source via IA_TICK_SEL bit. Source clock selection for timer tick 0x0 = Bus clock (aclk) 0x1 = Function clock (mclk) Signed-off-by: Peter Griffin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Krzysztof Kozlowski <[email protected]> Tested-by: Will McVicker <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 449adb0 commit 9238cad

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

drivers/ufs/host/ufs-exynos.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
#define HCI_ERR_EN_N_LAYER 0x80
5151
#define HCI_ERR_EN_T_LAYER 0x84
5252
#define HCI_ERR_EN_DME_LAYER 0x88
53+
#define HCI_V2P1_CTRL 0x8C
54+
#define IA_TICK_SEL BIT(16)
5355
#define HCI_CLKSTOP_CTRL 0xB0
5456
#define REFCLKOUT_STOP BIT(4)
5557
#define MPHY_APBCLK_STOP BIT(3)
@@ -1005,6 +1007,13 @@ static void exynos_ufs_fit_aggr_timeout(struct exynos_ufs *ufs)
10051007
{
10061008
u32 val;
10071009

1010+
/* Select function clock (mclk) for timer tick */
1011+
if (ufs->opts & EXYNOS_UFS_OPT_TIMER_TICK_SELECT) {
1012+
val = hci_readl(ufs, HCI_V2P1_CTRL);
1013+
val |= IA_TICK_SEL;
1014+
hci_writel(ufs, val, HCI_V2P1_CTRL);
1015+
}
1016+
10081017
val = exynos_ufs_calc_time_cntr(ufs, IATOVAL_NSEC / CNTR_DIV_VAL);
10091018
hci_writel(ufs, val & CNT_VAL_1US_MASK, HCI_1US_TO_CNT_VAL);
10101019
}

drivers/ufs/host/ufs-exynos.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ struct exynos_ufs {
222222
#define EXYNOS_UFS_OPT_USE_SW_HIBERN8_TIMER BIT(4)
223223
#define EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR BIT(5)
224224
#define EXYNOS_UFS_OPT_UFSPR_SECURE BIT(6)
225+
#define EXYNOS_UFS_OPT_TIMER_TICK_SELECT BIT(7)
225226
};
226227

227228
#define for_each_ufs_rx_lane(ufs, i) \

0 commit comments

Comments
 (0)