PCI: rockchip: dw: Optimize power down process

PCI Express Card Electromechanical Specification Revision 3.0
2.2.3. Power Down:
  3.3V/12V    _________________________________
                                               \__________
  PERST#      ______________
                            \_____________________________
  REFCLK      _________________________
                                       \__________________
  LINK        ______
                    \_____________________________________

Change-Id: I9f630c85a8022c02232f5898f35556f3eab20cfb
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
This commit is contained in:
Jon Lin
2025-04-13 09:19:40 +08:00
committed by Tao Huang
parent 1cb5049373
commit 4934e2a65f

View File

@@ -1518,14 +1518,26 @@ disable_vpcie3v3:
static int rk_pcie_hardware_io_unconfig(struct rk_pcie *rk_pcie)
{
/*
* PCI Express Card Electromechanical Specification Revision 3.0
* 2.2.3. Power Down
* 3.3V/12V _________________________________
* \__________
* PERST# ______________
* \_____________________________
* REFCLK _________________________
* \__________________
* LINK ______
* \_____________________________________
*/
if (rk_pcie_check_keep_power_in_suspend(rk_pcie))
gpiod_set_value_cansleep(rk_pcie->rst_gpio, 0);
phy_power_off(rk_pcie->phy);
phy_exit(rk_pcie->phy);
clk_bulk_disable_unprepare(rk_pcie->clk_cnt, rk_pcie->clks);
reset_control_assert(rk_pcie->rsts);
if (rk_pcie_check_keep_power_in_suspend(rk_pcie)) {
if (rk_pcie_check_keep_power_in_suspend(rk_pcie))
rk_pcie_disable_power(rk_pcie);
gpiod_set_value_cansleep(rk_pcie->rst_gpio, 0);
}
return 0;
}