]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
phy: marvell: cp110: update mode parameter for pcie power on calls
authorIgal Liberman <igall@marvell.com>
Sun, 18 Oct 2020 14:11:13 +0000 (17:11 +0300)
committerStefan Roese <sr@denx.de>
Thu, 29 Oct 2020 07:00:12 +0000 (08:00 +0100)
It helps ATF to determine who called power on function (U-boot/Linux).

The corresponding ATF code was added in this commit:

  mvebu: cp110: avoid pcie power on/off sequence when called from Linux
  https://github.com/ARM-software/arm-trusted-firmware/commit/55df84f974ea37abbb4f93f000f101f70cda5303

Signed-off-by: Igal Liberman <igall@marvell.com>
Reviewed-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
drivers/phy/marvell/comphy_cp110.c

index 5b6aaa62487b7abc9e503813382f9edf39db28e9..b0fcb13f1c9ac69a4cb74b7f6a437ce27be59c3d 100644 (file)
@@ -28,13 +28,16 @@ DECLARE_GLOBAL_DATA_PTR;
 #define MV_SIP_COMPHY_POWER_OFF        0x82000002
 #define MV_SIP_COMPHY_PLL_LOCK 0x82000003
 
+/* Used to distinguish between different possible callers (U-boot/Linux) */
+#define COMPHY_CALLER_UBOOT                    (0x1 << 21)
+
 #define COMPHY_FW_MODE_FORMAT(mode)            ((mode) << 12)
 #define COMPHY_FW_FORMAT(mode, idx, speeds)    \
                        (((mode) << 12) | ((idx) << 8) | ((speeds) << 2))
 
 #define COMPHY_FW_PCIE_FORMAT(pcie_width, clk_src, mode, speeds)       \
-                       (((pcie_width) << 18) | ((clk_src) << 17) |     \
-                        COMPHY_FW_FORMAT(mode, 0, speeds))
+                       (COMPHY_CALLER_UBOOT | ((pcie_width) << 18) |   \
+                       ((clk_src) << 17) | COMPHY_FW_FORMAT(mode, 0, speeds))
 
 #define COMPHY_SATA_MODE       0x1
 #define COMPHY_SGMII_MODE      0x2     /* SGMII 1G */