OSDN Git Service

soc: imx: imx8mp-blk-ctrl: handle PCIe PHY resets
authorLucas Stach <l.stach@pengutronix.de>
Fri, 2 Sep 2022 08:58:04 +0000 (16:58 +0800)
committerShawn Guo <shawnguo@kernel.org>
Sat, 17 Sep 2022 08:30:54 +0000 (16:30 +0800)
Dessert the PHY reset when powering up the domain and put it back
into reset when the domain is powered down.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
drivers/soc/imx/imx8mp-blk-ctrl.c

index 527d45d..ccb30c6 100644 (file)
@@ -19,6 +19,8 @@
 #define GPR_REG0               0x0
 #define  PCIE_CLOCK_MODULE_EN  BIT(0)
 #define  USB_CLOCK_MODULE_EN   BIT(1)
+#define  PCIE_PHY_APB_RST      BIT(4)
+#define  PCIE_PHY_INIT_RST     BIT(5)
 
 struct imx8mp_blk_ctrl_domain;
 
@@ -81,6 +83,10 @@ static void imx8mp_hsio_blk_ctrl_power_on(struct imx8mp_blk_ctrl *bc,
        case IMX8MP_HSIOBLK_PD_PCIE:
                regmap_set_bits(bc->regmap, GPR_REG0, PCIE_CLOCK_MODULE_EN);
                break;
+       case IMX8MP_HSIOBLK_PD_PCIE_PHY:
+               regmap_set_bits(bc->regmap, GPR_REG0,
+                               PCIE_PHY_APB_RST | PCIE_PHY_INIT_RST);
+               break;
        default:
                break;
        }
@@ -96,6 +102,10 @@ static void imx8mp_hsio_blk_ctrl_power_off(struct imx8mp_blk_ctrl *bc,
        case IMX8MP_HSIOBLK_PD_PCIE:
                regmap_clear_bits(bc->regmap, GPR_REG0, PCIE_CLOCK_MODULE_EN);
                break;
+       case IMX8MP_HSIOBLK_PD_PCIE_PHY:
+               regmap_clear_bits(bc->regmap, GPR_REG0,
+                                 PCIE_PHY_APB_RST | PCIE_PHY_INIT_RST);
+               break;
        default:
                break;
        }