mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
scsi: ufs: amd-versal2: Add UFS support for AMD Versal Gen 2 SoC
Add support for the UFS host controller on the AMD Versal Gen 2 SoC, built on the Synopsys DWC UFS architecture, using the UFSHCD DWC and UFSHCD platform driver. This controller requires specific configurations like M-PHY/RMMI/UniPro and vendor specific registers programming before doing the UIC_LINKSTARTUP. Signed-off-by: Sai Krishna Potthuri <sai.krishna.potthuri@amd.com> Signed-off-by: Ajay Neeli <ajay.neeli@amd.com> Acked-by: Bart Van Assche <bvanassche@acm.org> Link: https://patch.msgid.link/20251021113003.13650-5-ajay.neeli@amd.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
committed by
Martin K. Petersen
parent
0e4d26f79a
commit
769b8b2ffd
@@ -26339,6 +26339,13 @@ F: Documentation/devicetree/bindings/ufs/
|
||||
F: Documentation/scsi/ufs.rst
|
||||
F: drivers/ufs/core/
|
||||
|
||||
UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER AMD VERSAL2
|
||||
M: Sai Krishna Potthuri <sai.krishna.potthuri@amd.com>
|
||||
M: Ajay Neeli <ajay.neeli@amd.com>
|
||||
S: Maintained
|
||||
F: Documentation/devicetree/bindings/ufs/amd,versal2-ufs.yaml
|
||||
F: drivers/ufs/host/ufs-amd-versal2.c
|
||||
|
||||
UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER DWC HOOKS
|
||||
M: Pedro Sousa <pedrom.sousa@synopsys.com>
|
||||
L: linux-scsi@vger.kernel.org
|
||||
|
||||
@@ -154,3 +154,16 @@ config SCSI_UFS_ROCKCHIP
|
||||
|
||||
Select this if you have UFS controller on Rockchip chipset.
|
||||
If unsure, say N.
|
||||
|
||||
config SCSI_UFS_AMD_VERSAL2
|
||||
tristate "AMD Versal Gen 2 UFS controller platform driver"
|
||||
depends on SCSI_UFSHCD_PLATFORM && (ARCH_ZYNQMP || COMPILE_TEST)
|
||||
help
|
||||
This selects the AMD Versal Gen 2 specific additions on top of
|
||||
the UFSHCD DWC and UFSHCD platform driver. UFS host on AMD
|
||||
Versal Gen 2 needs some vendor specific configurations like PHY
|
||||
and vendor specific register accesses before accessing the
|
||||
hardware.
|
||||
|
||||
Select this if you have UFS controller on AMD Versal Gen 2 SoC.
|
||||
If unsure, say N.
|
||||
|
||||
@@ -13,3 +13,4 @@ obj-$(CONFIG_SCSI_UFS_RENESAS) += ufs-renesas.o
|
||||
obj-$(CONFIG_SCSI_UFS_ROCKCHIP) += ufs-rockchip.o
|
||||
obj-$(CONFIG_SCSI_UFS_SPRD) += ufs-sprd.o
|
||||
obj-$(CONFIG_SCSI_UFS_TI_J721E) += ti-j721e-ufs.o
|
||||
obj-$(CONFIG_SCSI_UFS_AMD_VERSAL2) += ufs-amd-versal2.o ufshcd-dwc.o
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -12,6 +12,52 @@
|
||||
|
||||
#include <ufs/ufshcd.h>
|
||||
|
||||
/* RMMI Attributes */
|
||||
#define CBREFCLKCTRL2 0x8132
|
||||
#define CBCRCTRL 0x811F
|
||||
#define CBC10DIRECTCONF2 0x810E
|
||||
#define CBRATESEL 0x8114
|
||||
#define CBCREGADDRLSB 0x8116
|
||||
#define CBCREGADDRMSB 0x8117
|
||||
#define CBCREGWRLSB 0x8118
|
||||
#define CBCREGWRMSB 0x8119
|
||||
#define CBCREGRDLSB 0x811A
|
||||
#define CBCREGRDMSB 0x811B
|
||||
#define CBCREGRDWRSEL 0x811C
|
||||
|
||||
#define CBREFREFCLK_GATE_OVR_EN BIT(7)
|
||||
|
||||
/* M-PHY Attributes */
|
||||
#define MTX_FSM_STATE 0x41
|
||||
#define MRX_FSM_STATE 0xC1
|
||||
|
||||
/* M-PHY registers */
|
||||
#define RX_OVRD_IN_1(n) (0x3006 + ((n) * 0x100))
|
||||
#define RX_PCS_OUT(n) (0x300F + ((n) * 0x100))
|
||||
#define FAST_FLAGS(n) (0x401C + ((n) * 0x100))
|
||||
#define RX_AFE_ATT_IDAC(n) (0x4000 + ((n) * 0x100))
|
||||
#define RX_AFE_CTLE_IDAC(n) (0x4001 + ((n) * 0x100))
|
||||
#define FW_CALIB_CCFG(n) (0x404D + ((n) * 0x100))
|
||||
|
||||
/* Tx/Rx FSM state */
|
||||
enum rx_fsm_state {
|
||||
RX_STATE_DISABLED = 0,
|
||||
RX_STATE_HIBERN8 = 1,
|
||||
RX_STATE_SLEEP = 2,
|
||||
RX_STATE_STALL = 3,
|
||||
RX_STATE_LSBURST = 4,
|
||||
RX_STATE_HSBURST = 5,
|
||||
};
|
||||
|
||||
enum tx_fsm_state {
|
||||
TX_STATE_DISABLED = 0,
|
||||
TX_STATE_HIBERN8 = 1,
|
||||
TX_STATE_SLEEP = 2,
|
||||
TX_STATE_STALL = 3,
|
||||
TX_STATE_LSBURST = 4,
|
||||
TX_STATE_HSBURST = 5,
|
||||
};
|
||||
|
||||
struct ufshcd_dme_attr_val {
|
||||
u32 attr_sel;
|
||||
u32 mib_val;
|
||||
|
||||
@@ -174,6 +174,7 @@
|
||||
#define VS_POWERSTATE 0xD083
|
||||
#define VS_MPHYCFGUPDT 0xD085
|
||||
#define VS_DEBUGOMC 0xD09E
|
||||
#define VS_MPHYDISABLE 0xD0C1
|
||||
|
||||
#define PA_GRANULARITY_MIN_VAL 1
|
||||
#define PA_GRANULARITY_MAX_VAL 6
|
||||
|
||||
Reference in New Issue
Block a user