phy-fsd-ufs.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * UFS PHY driver data for FSD SoC
  4. *
  5. * Copyright (C) 2022 Samsung Electronics Co., Ltd.
  6. *
  7. */
  8. #include "phy-samsung-ufs.h"
  9. #define FSD_EMBEDDED_COMBO_PHY_CTRL 0x724
  10. #define FSD_EMBEDDED_COMBO_PHY_CTRL_MASK 0x1
  11. #define FSD_EMBEDDED_COMBO_PHY_CTRL_EN BIT(0)
  12. #define FSD_EMBEDDED_COMBO_PHY_CDR_LOCK_STATUS 0x6e
  13. static const struct samsung_ufs_phy_cfg fsd_pre_init_cfg[] = {
  14. PHY_COMN_REG_CFG(0x00f, 0xfa, PWR_MODE_ANY),
  15. PHY_COMN_REG_CFG(0x010, 0x82, PWR_MODE_ANY),
  16. PHY_COMN_REG_CFG(0x011, 0x1e, PWR_MODE_ANY),
  17. PHY_COMN_REG_CFG(0x017, 0x94, PWR_MODE_ANY),
  18. PHY_TRSV_REG_CFG(0x035, 0x58, PWR_MODE_ANY),
  19. PHY_TRSV_REG_CFG(0x036, 0x32, PWR_MODE_ANY),
  20. PHY_TRSV_REG_CFG(0x037, 0x40, PWR_MODE_ANY),
  21. PHY_TRSV_REG_CFG(0x03b, 0x83, PWR_MODE_ANY),
  22. PHY_TRSV_REG_CFG(0x042, 0x88, PWR_MODE_ANY),
  23. PHY_TRSV_REG_CFG(0x043, 0xa6, PWR_MODE_ANY),
  24. PHY_TRSV_REG_CFG(0x048, 0x74, PWR_MODE_ANY),
  25. PHY_TRSV_REG_CFG(0x04c, 0x5b, PWR_MODE_ANY),
  26. PHY_TRSV_REG_CFG(0x04d, 0x83, PWR_MODE_ANY),
  27. PHY_TRSV_REG_CFG(0x05c, 0x14, PWR_MODE_ANY),
  28. END_UFS_PHY_CFG
  29. };
  30. /* Calibration for HS mode series A/B */
  31. static const struct samsung_ufs_phy_cfg fsd_pre_pwr_hs_cfg[] = {
  32. END_UFS_PHY_CFG
  33. };
  34. /* Calibration for HS mode series A/B atfer PMC */
  35. static const struct samsung_ufs_phy_cfg fsd_post_pwr_hs_cfg[] = {
  36. END_UFS_PHY_CFG
  37. };
  38. static const struct samsung_ufs_phy_cfg *fsd_ufs_phy_cfgs[CFG_TAG_MAX] = {
  39. [CFG_PRE_INIT] = fsd_pre_init_cfg,
  40. [CFG_PRE_PWR_HS] = fsd_pre_pwr_hs_cfg,
  41. [CFG_POST_PWR_HS] = fsd_post_pwr_hs_cfg,
  42. };
  43. static const char * const fsd_ufs_phy_clks[] = {
  44. "ref_clk",
  45. };
  46. const struct samsung_ufs_phy_drvdata fsd_ufs_phy = {
  47. .cfgs = fsd_ufs_phy_cfgs,
  48. .isol = {
  49. .offset = FSD_EMBEDDED_COMBO_PHY_CTRL,
  50. .mask = FSD_EMBEDDED_COMBO_PHY_CTRL_MASK,
  51. .en = FSD_EMBEDDED_COMBO_PHY_CTRL_EN,
  52. },
  53. .clk_list = fsd_ufs_phy_clks,
  54. .num_clks = ARRAY_SIZE(fsd_ufs_phy_clks),
  55. .cdr_lock_status_offset = FSD_EMBEDDED_COMBO_PHY_CDR_LOCK_STATUS,
  56. };