PCI: dw: rockchip: Add shutdown support

There is nothing worth to do when rebooting in normal system
as the whole thing is going to be reset in a clean way. However
if the reboot process doesn't reset the anything, then reset
PCIe controller in probe would throw a glitch which could generate
a spurious irq. Work around this by disabling misc irq before rebooting.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I7b6e53ecbce385581a6beb0333a2df320a32cc9e
This commit is contained in:
Shawn Lin
2024-11-05 09:19:47 +08:00
committed by Tao Huang
parent 3d8361c678
commit 47fd8822fa

View File

@@ -1777,6 +1777,16 @@ static int rk_pcie_remove(struct platform_device *pdev)
return 0;
}
static void rk_pcie_shutdown(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct rk_pcie *rk_pcie = dev_get_drvdata(dev);
dev_dbg(rk_pcie->pci->dev, "shutdown...\n");
rk_pcie_disable_ltssm(rk_pcie);
rk_pcie_writel_apb(rk_pcie, PCIE_CLIENT_INTR_MASK, 0xffffffff);
}
#ifdef CONFIG_PCIEASPM
static void rk_pcie_downstream_dev_to_d0(struct rk_pcie *rk_pcie, bool enable)
{
@@ -2082,6 +2092,7 @@ static struct platform_driver rk_plat_pcie_driver = {
},
.probe = rk_pcie_probe,
.remove = rk_pcie_remove,
.shutdown = rk_pcie_shutdown,
};
module_platform_driver(rk_plat_pcie_driver);