1*df7320baSZhe Wang /* SPDX-License-Identifier: GPL-2.0-only */ 2*df7320baSZhe Wang /* 3*df7320baSZhe Wang * UNISOC UFS Host Controller driver 4*df7320baSZhe Wang * 5*df7320baSZhe Wang * Copyright (C) 2022 Unisoc, Inc. 6*df7320baSZhe Wang * Author: Zhe Wang <zhe.wang1@unisoc.com> 7*df7320baSZhe Wang */ 8*df7320baSZhe Wang 9*df7320baSZhe Wang #ifndef _UFS_SPRD_H_ 10*df7320baSZhe Wang #define _UFS_SPRD_H_ 11*df7320baSZhe Wang 12*df7320baSZhe Wang /* Vendor specific attributes */ 13*df7320baSZhe Wang #define RXSQCONTROL 0x8009 14*df7320baSZhe Wang #define CBRATESEL 0x8114 15*df7320baSZhe Wang #define CBCREGADDRLSB 0x8116 16*df7320baSZhe Wang #define CBCREGADDRMSB 0x8117 17*df7320baSZhe Wang #define CBCREGWRLSB 0x8118 18*df7320baSZhe Wang #define CBCREGWRMSB 0x8119 19*df7320baSZhe Wang #define CBCREGRDWRSEL 0x811C 20*df7320baSZhe Wang #define CBCRCTRL 0x811F 21*df7320baSZhe Wang #define CBREFCLKCTRL2 0x8132 22*df7320baSZhe Wang #define VS_MPHYDISABLE 0xD0C1 23*df7320baSZhe Wang 24*df7320baSZhe Wang #define APB_UFSDEV_REG 0xCE8 25*df7320baSZhe Wang #define APB_UFSDEV_REFCLK_EN 0x2 26*df7320baSZhe Wang #define APB_USB31PLL_CTRL 0xCFC 27*df7320baSZhe Wang #define APB_USB31PLLV_REF2MPHY 0x1 28*df7320baSZhe Wang 29*df7320baSZhe Wang #define SPRD_SIP_SVC_STORAGE_UFS_CRYPTO_ENABLE \ 30*df7320baSZhe Wang ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ 31*df7320baSZhe Wang ARM_SMCCC_SMC_32, \ 32*df7320baSZhe Wang ARM_SMCCC_OWNER_SIP, \ 33*df7320baSZhe Wang 0x0301) 34*df7320baSZhe Wang 35*df7320baSZhe Wang enum SPRD_UFS_RST_INDEX { 36*df7320baSZhe Wang SPRD_UFSHCI_SOFT_RST, 37*df7320baSZhe Wang SPRD_UFS_DEV_RST, 38*df7320baSZhe Wang 39*df7320baSZhe Wang SPRD_UFS_RST_MAX 40*df7320baSZhe Wang }; 41*df7320baSZhe Wang 42*df7320baSZhe Wang enum SPRD_UFS_SYSCON_INDEX { 43*df7320baSZhe Wang SPRD_UFS_ANLG, 44*df7320baSZhe Wang SPRD_UFS_AON_APB, 45*df7320baSZhe Wang 46*df7320baSZhe Wang SPRD_UFS_SYSCON_MAX 47*df7320baSZhe Wang }; 48*df7320baSZhe Wang 49*df7320baSZhe Wang enum SPRD_UFS_VREG_INDEX { 50*df7320baSZhe Wang SPRD_UFS_VDD_MPHY, 51*df7320baSZhe Wang 52*df7320baSZhe Wang SPRD_UFS_VREG_MAX 53*df7320baSZhe Wang }; 54*df7320baSZhe Wang 55*df7320baSZhe Wang struct ufs_sprd_rst { 56*df7320baSZhe Wang const char *name; 57*df7320baSZhe Wang struct reset_control *rc; 58*df7320baSZhe Wang }; 59*df7320baSZhe Wang 60*df7320baSZhe Wang struct ufs_sprd_syscon { 61*df7320baSZhe Wang const char *name; 62*df7320baSZhe Wang struct regmap *regmap; 63*df7320baSZhe Wang }; 64*df7320baSZhe Wang 65*df7320baSZhe Wang struct ufs_sprd_vreg { 66*df7320baSZhe Wang const char *name; 67*df7320baSZhe Wang struct regulator *vreg; 68*df7320baSZhe Wang }; 69*df7320baSZhe Wang 70*df7320baSZhe Wang struct ufs_sprd_priv { 71*df7320baSZhe Wang struct ufs_sprd_rst rci[SPRD_UFS_RST_MAX]; 72*df7320baSZhe Wang struct ufs_sprd_syscon sysci[SPRD_UFS_SYSCON_MAX]; 73*df7320baSZhe Wang struct ufs_sprd_vreg vregi[SPRD_UFS_VREG_MAX]; 74*df7320baSZhe Wang const struct ufs_hba_variant_ops ufs_hba_sprd_vops; 75*df7320baSZhe Wang }; 76*df7320baSZhe Wang 77*df7320baSZhe Wang struct ufs_sprd_host { 78*df7320baSZhe Wang struct ufs_hba *hba; 79*df7320baSZhe Wang struct ufs_sprd_priv *priv; 80*df7320baSZhe Wang void __iomem *ufs_dbg_mmio; 81*df7320baSZhe Wang 82*df7320baSZhe Wang enum ufs_unipro_ver unipro_ver; 83*df7320baSZhe Wang }; 84*df7320baSZhe Wang 85*df7320baSZhe Wang #endif /* _UFS_SPRD_H_ */ 86