@@ -308,8 +308,9 @@ static int exynosauto_ufs_post_pwr_change(struct exynos_ufs *ufs,
308
308
309
309
static int exynos7_ufs_pre_link (struct exynos_ufs * ufs )
310
310
{
311
+ struct exynos_ufs_uic_attr * attr = ufs -> drv_data -> uic_attr ;
312
+ u32 val = attr -> pa_dbg_opt_suite1_val ;
311
313
struct ufs_hba * hba = ufs -> hba ;
312
- u32 val = ufs -> drv_data -> uic_attr -> pa_dbg_option_suite ;
313
314
int i ;
314
315
315
316
exynos_ufs_enable_ov_tm (hba );
@@ -326,12 +327,13 @@ static int exynos7_ufs_pre_link(struct exynos_ufs *ufs)
326
327
UIC_ARG_MIB_SEL (TX_HIBERN8_CONTROL , i ), 0x0 );
327
328
ufshcd_dme_set (hba , UIC_ARG_MIB (PA_DBG_TXPHY_CFGUPDT ), 0x1 );
328
329
udelay (1 );
329
- ufshcd_dme_set (hba , UIC_ARG_MIB (PA_DBG_OPTION_SUITE ), val | (1 << 12 ));
330
+ ufshcd_dme_set (hba , UIC_ARG_MIB (attr -> pa_dbg_opt_suite1_off ),
331
+ val | (1 << 12 ));
330
332
ufshcd_dme_set (hba , UIC_ARG_MIB (PA_DBG_SKIP_RESET_PHY ), 0x1 );
331
333
ufshcd_dme_set (hba , UIC_ARG_MIB (PA_DBG_SKIP_LINE_RESET ), 0x1 );
332
334
ufshcd_dme_set (hba , UIC_ARG_MIB (PA_DBG_LINE_RESET_REQ ), 0x1 );
333
335
udelay (1600 );
334
- ufshcd_dme_set (hba , UIC_ARG_MIB (PA_DBG_OPTION_SUITE ), val );
336
+ ufshcd_dme_set (hba , UIC_ARG_MIB (attr -> pa_dbg_opt_suite1_off ), val );
335
337
336
338
return 0 ;
337
339
}
@@ -923,14 +925,19 @@ static int exynos_ufs_phy_init(struct exynos_ufs *ufs)
923
925
924
926
static void exynos_ufs_config_unipro (struct exynos_ufs * ufs )
925
927
{
928
+ struct exynos_ufs_uic_attr * attr = ufs -> drv_data -> uic_attr ;
926
929
struct ufs_hba * hba = ufs -> hba ;
927
930
928
- ufshcd_dme_set (hba , UIC_ARG_MIB (PA_DBG_CLK_PERIOD ),
929
- DIV_ROUND_UP (NSEC_PER_SEC , ufs -> mclk_rate ));
931
+ if (attr -> pa_dbg_clk_period_off )
932
+ ufshcd_dme_set (hba , UIC_ARG_MIB (attr -> pa_dbg_clk_period_off ),
933
+ DIV_ROUND_UP (NSEC_PER_SEC , ufs -> mclk_rate ));
934
+
930
935
ufshcd_dme_set (hba , UIC_ARG_MIB (PA_TXTRAILINGCLOCKS ),
931
936
ufs -> drv_data -> uic_attr -> tx_trailingclks );
932
- ufshcd_dme_set (hba , UIC_ARG_MIB (PA_DBG_OPTION_SUITE ),
933
- ufs -> drv_data -> uic_attr -> pa_dbg_option_suite );
937
+
938
+ if (attr -> pa_dbg_opt_suite1_off )
939
+ ufshcd_dme_set (hba , UIC_ARG_MIB (attr -> pa_dbg_opt_suite1_off ),
940
+ attr -> pa_dbg_opt_suite1_val );
934
941
}
935
942
936
943
static void exynos_ufs_config_intr (struct exynos_ufs * ufs , u32 errs , u8 index )
@@ -1487,10 +1494,11 @@ static int exynosauto_ufs_vh_init(struct ufs_hba *hba)
1487
1494
1488
1495
static int fsd_ufs_pre_link (struct exynos_ufs * ufs )
1489
1496
{
1490
- int i ;
1497
+ struct exynos_ufs_uic_attr * attr = ufs -> drv_data -> uic_attr ;
1491
1498
struct ufs_hba * hba = ufs -> hba ;
1499
+ int i ;
1492
1500
1493
- ufshcd_dme_set (hba , UIC_ARG_MIB (PA_DBG_CLK_PERIOD ),
1501
+ ufshcd_dme_set (hba , UIC_ARG_MIB (attr -> pa_dbg_clk_period_off ),
1494
1502
DIV_ROUND_UP (NSEC_PER_SEC , ufs -> mclk_rate ));
1495
1503
ufshcd_dme_set (hba , UIC_ARG_MIB (0x201 ), 0x12 );
1496
1504
ufshcd_dme_set (hba , UIC_ARG_MIB (0x200 ), 0x40 );
@@ -1514,7 +1522,9 @@ static int fsd_ufs_pre_link(struct exynos_ufs *ufs)
1514
1522
1515
1523
ufshcd_dme_set (hba , UIC_ARG_MIB (0x200 ), 0x0 );
1516
1524
ufshcd_dme_set (hba , UIC_ARG_MIB (PA_DBG_AUTOMODE_THLD ), 0x4E20 );
1517
- ufshcd_dme_set (hba , UIC_ARG_MIB (PA_DBG_OPTION_SUITE ), 0x2e820183 );
1525
+
1526
+ ufshcd_dme_set (hba , UIC_ARG_MIB (attr -> pa_dbg_opt_suite1_off ),
1527
+ 0x2e820183 );
1518
1528
ufshcd_dme_set (hba , UIC_ARG_MIB (PA_LOCAL_TX_LCC_ENABLE ), 0x0 );
1519
1529
1520
1530
exynos_ufs_establish_connt (ufs );
@@ -1656,7 +1666,9 @@ static struct exynos_ufs_uic_attr exynos7_uic_attr = {
1656
1666
.rx_hs_g1_prep_sync_len_cap = PREP_LEN (0xf ),
1657
1667
.rx_hs_g2_prep_sync_len_cap = PREP_LEN (0xf ),
1658
1668
.rx_hs_g3_prep_sync_len_cap = PREP_LEN (0xf ),
1659
- .pa_dbg_option_suite = 0x30103 ,
1669
+ .pa_dbg_clk_period_off = PA_DBG_CLK_PERIOD ,
1670
+ .pa_dbg_opt_suite1_val = 0x30103 ,
1671
+ .pa_dbg_opt_suite1_off = PA_DBG_OPTION_SUITE ,
1660
1672
};
1661
1673
1662
1674
static const struct exynos_ufs_drv_data exynosauto_ufs_drvs = {
@@ -1730,7 +1742,9 @@ static struct exynos_ufs_uic_attr fsd_uic_attr = {
1730
1742
.rx_hs_g1_prep_sync_len_cap = PREP_LEN (0xf ),
1731
1743
.rx_hs_g2_prep_sync_len_cap = PREP_LEN (0xf ),
1732
1744
.rx_hs_g3_prep_sync_len_cap = PREP_LEN (0xf ),
1733
- .pa_dbg_option_suite = 0x2E820183 ,
1745
+ .pa_dbg_clk_period_off = PA_DBG_CLK_PERIOD ,
1746
+ .pa_dbg_opt_suite1_val = 0x2E820183 ,
1747
+ .pa_dbg_opt_suite1_off = PA_DBG_OPTION_SUITE ,
1734
1748
};
1735
1749
1736
1750
static const struct exynos_ufs_drv_data fsd_ufs_drvs = {
0 commit comments