scsi: ufs: renesas: Refactor 0x10ad/0x10af PHY settings

Extract specific PHY setting of the 0x10a[df] registers into a new
function.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/110eafd1ee24f9db0285a5e2bca224e35962268a.1741179611.git.geert+renesas@glider.be
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Yoshihiro Shimoda
2025-03-05 14:34:13 +01:00
committed by Martin K. Petersen
parent 855bde8ce5
commit cca2b807c2

View File

@@ -135,6 +135,16 @@ static void ufs_renesas_indirect_poll(struct ufs_hba *hba, u32 gpio, u32 addr,
ufs_renesas_write(hba, 0xf0, 0);
}
static void ufs_renesas_write_phy_10ad_10af(struct ufs_hba *hba,
u32 data_10ad, u32 data_10af)
{
ufs_renesas_write_phy(hba, 0x10ae, 0x0001);
ufs_renesas_write_phy(hba, 0x10ad, data_10ad);
ufs_renesas_write_phy(hba, 0x10af, data_10af);
ufs_renesas_write_phy(hba, 0x10b6, 0x0001);
ufs_renesas_write_phy(hba, 0x10ae, 0x0000);
}
static void ufs_renesas_pre_init(struct ufs_hba *hba)
{
u32 timer_val;
@@ -209,29 +219,10 @@ static void ufs_renesas_pre_init(struct ufs_hba *hba)
ufs_renesas_write_phy(hba, 0x4000, 0x0000);
ufs_renesas_write_phy(hba, 0x4001, 0x0000);
ufs_renesas_write_phy(hba, 0x10ae, 0x0001);
ufs_renesas_write_phy(hba, 0x10ad, 0x0000);
ufs_renesas_write_phy(hba, 0x10af, 0x0001);
ufs_renesas_write_phy(hba, 0x10b6, 0x0001);
ufs_renesas_write_phy(hba, 0x10ae, 0x0000);
ufs_renesas_write_phy(hba, 0x10ae, 0x0001);
ufs_renesas_write_phy(hba, 0x10ad, 0x0000);
ufs_renesas_write_phy(hba, 0x10af, 0x0002);
ufs_renesas_write_phy(hba, 0x10b6, 0x0001);
ufs_renesas_write_phy(hba, 0x10ae, 0x0000);
ufs_renesas_write_phy(hba, 0x10ae, 0x0001);
ufs_renesas_write_phy(hba, 0x10ad, 0x0080);
ufs_renesas_write_phy(hba, 0x10af, 0x0000);
ufs_renesas_write_phy(hba, 0x10b6, 0x0001);
ufs_renesas_write_phy(hba, 0x10ae, 0x0000);
ufs_renesas_write_phy(hba, 0x10ae, 0x0001);
ufs_renesas_write_phy(hba, 0x10ad, 0x0080);
ufs_renesas_write_phy(hba, 0x10af, 0x001a);
ufs_renesas_write_phy(hba, 0x10b6, 0x0001);
ufs_renesas_write_phy(hba, 0x10ae, 0x0000);
ufs_renesas_write_phy_10ad_10af(hba, 0x0000, 0x0001);
ufs_renesas_write_phy_10ad_10af(hba, 0x0000, 0x0002);
ufs_renesas_write_phy_10ad_10af(hba, 0x0080, 0x0000);
ufs_renesas_write_phy_10ad_10af(hba, 0x0080, 0x001a);
ufs_renesas_indirect_write(hba, 7, 0x70, 0x0016);
ufs_renesas_indirect_write(hba, 7, 0x71, 0x0016);