[PATCH v11 09/14] ufs: dwc: Move shared M-PHY CR bitfield macros to ufshcd-dwc.h

Larisa Grigore via B4 Relay devnull+larisa.grigore.oss.nxp.com at kernel.org
Sat Nov 14 03:55:41 PST 2026


From: Larisa Grigore <larisa.grigore at oss.nxp.com>

The bitfields of the FAST_FLAGS, FW_CALIB_CCFG, RX_OVRD_IN_1 and
RX_PCS_OUT M-PHY registers are defined in the AMD Versal2 driver, while
the register offsets themselves are already in ufshcd-dwc.h.

Move the bitfield macros next to the register offsets so other DWC based
drivers can program these registers without using raw values.

No functional change.

Signed-off-by: Larisa Grigore <larisa.grigore at oss.nxp.com>
---
 drivers/ufs/host/ufs-amd-versal2.c |  7 -------
 drivers/ufs/host/ufshcd-dwc.h      | 13 +++++++++++++
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/drivers/ufs/host/ufs-amd-versal2.c b/drivers/ufs/host/ufs-amd-versal2.c
index 4d6e08ac6ced..dcca6be5dad0 100644
--- a/drivers/ufs/host/ufs-amd-versal2.c
+++ b/drivers/ufs/host/ufs-amd-versal2.c
@@ -22,13 +22,6 @@
 /* PHY modes */
 #define UFSHCD_DWC_PHY_MODE_ROM         0
 
-#define MPHY_FAST_RX_AFE_CAL		BIT(2)
-#define MPHY_FW_CALIB_CFG_VAL		BIT(8)
-
-#define MPHY_RX_OVRD_EN			BIT(3)
-#define MPHY_RX_OVRD_VAL		BIT(2)
-#define MPHY_RX_ACK_MASK		BIT(0)
-
 #define TIMEOUT_MICROSEC	1000000
 
 struct ufs_versal2_host {
diff --git a/drivers/ufs/host/ufshcd-dwc.h b/drivers/ufs/host/ufshcd-dwc.h
index 1abf2b1deac4..a76009b42088 100644
--- a/drivers/ufs/host/ufshcd-dwc.h
+++ b/drivers/ufs/host/ufshcd-dwc.h
@@ -35,6 +35,19 @@
 #define RX_AFE_CTLE_IDAC(n)	(0x4001 + ((n) * 0x100))
 #define FW_CALIB_CCFG(n)	(0x404D + ((n) * 0x100))
 
+/* RX_OVRD_IN_1 */
+#define MPHY_RX_OVRD_EN			BIT(3)
+#define MPHY_RX_OVRD_VAL		BIT(2)
+
+/* RX_PCS_OUT */
+#define MPHY_RX_ACK_MASK		BIT(0)
+
+/* FAST_FLAGS */
+#define MPHY_FAST_RX_AFE_CAL		BIT(2)
+
+/* FW_CALIB_CCFG */
+#define MPHY_FW_CALIB_CFG_VAL		BIT(8)
+
 struct ufshcd_dme_attr_val {
 	u32 attr_sel;
 	u32 mib_val;

-- 
2.43.0





More information about the Linux-rockchip mailing list