From 580742d003f6f91dac5a21519b09bb07b58a226b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Beh=C3=BAn?= Date: Thu, 2 Dec 2021 20:04:57 +0100 Subject: [PATCH] refactor(drivers/marvell/comphy-3700): move and add comment for COMPHY_RESERVED_REG MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The COMPHY_RESERVED_REG (offset 0x0E) is currently defined between COMPHY_KVCO_CAL_CTRL (0x02) and COMPHY_DIG_LOOPBACK_EN (0x23). But this register does not come from PHY lane register space. The address 0x0E is not relative to PHY lane registers base address. It only exists in the indirect register space, before PHY lane 2 registers (which start at address 0x200). Move its definition in the header and add a comment. Signed-off-by: Marek BehĂșn Change-Id: Ie726384b980ace83d8ea327df09d928db74c2ab7 --- drivers/marvell/comphy/phy-comphy-3700.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/marvell/comphy/phy-comphy-3700.h b/drivers/marvell/comphy/phy-comphy-3700.h index 5cdec5817..95b9e8fe0 100644 --- a/drivers/marvell/comphy/phy-comphy-3700.h +++ b/drivers/marvell/comphy/phy-comphy-3700.h @@ -72,9 +72,6 @@ enum { #define SPEED_PLL_MASK (0x3F << SPEED_PLL_OFFSET) #define SPEED_PLL_VALUE_16 (0x10 << SPEED_PLL_OFFSET) -#define COMPHY_RESERVED_REG 0x0E -#define PHYCTRL_FRM_PIN_BIT BIT(13) - #define COMPHY_DIG_LOOPBACK_EN 0x23 #define DIG_LOOPBACK_EN_ADDR(unit) (COMPHY_DIG_LOOPBACK_EN * \ PHY_SHFT(unit)) @@ -221,6 +218,15 @@ enum { #define CFG_PM_RXDLOZ_WAIT_7_UNIT (7 << CFG_PM_RXDLOZ_WAIT_OFF) #define CFG_PM_RXDLOZ_WAIT_12_UNIT (0xC << CFG_PM_RXDLOZ_WAIT_OFF) +/* + * This register is not from PHY lane register space. It only exists in the + * indirect register space, before the actual PHY lane 2 registers. So the + * offset is absolute, not relative to SATAPHY_LANE2_REG_BASE_OFFSET. + * It is used only for SATA PHY initialization. + */ +#define COMPHY_RESERVED_REG 0x0E +#define PHYCTRL_FRM_PIN_BIT BIT(13) + /* SGMII */ #define COMPHY_PHY_CFG1_OFFSET(lane) ((1 - (lane)) * 0x28) #define PIN_PU_IVREF_BIT BIT(1)