PCI: rockchip: Assert PCI Configuration Enable bit after probe
authorRick Wertenbroek <rick.wertenbroek@gmail.com>
Tue, 18 Apr 2023 07:46:50 +0000 (09:46 +0200)
committerLorenzo Pieralisi <lpieralisi@kernel.org>
Thu, 22 Jun 2023 07:36:51 +0000 (09:36 +0200)
Assert PCI Configuration Enable bit after probe. When this bit is left to
0 in the endpoint mode, the RK3399 PCIe endpoint core will generate
configuration request retry status (CRS) messages back to the root complex.
Assert this bit after probe to allow the RK3399 PCIe endpoint core to reply
to configuration requests from the root complex.
This is documented in section 17.5.8.1.2 of the RK3399 TRM.

Link: https://lore.kernel.org/r/20230418074700.1083505-4-rick.wertenbroek@gmail.com
Fixes: cf590b078391 ("PCI: rockchip: Add EP driver for Rockchip PCIe controller")
Tested-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Rick Wertenbroek <rick.wertenbroek@gmail.com>
Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Cc: stable@vger.kernel.org
drivers/pci/controller/pcie-rockchip-ep.c

index 9b835377bd9e2c88a0eba08eb9dca37bce1a11f9..d00baed65ebaa91e773596136131b43738be94ff 100644 (file)
@@ -623,6 +623,9 @@ static int rockchip_pcie_ep_probe(struct platform_device *pdev)
 
        ep->irq_pci_addr = ROCKCHIP_PCIE_EP_DUMMY_IRQ_ADDR;
 
+       rockchip_pcie_write(rockchip, PCIE_CLIENT_CONF_ENABLE,
+                           PCIE_CLIENT_CONFIG);
+
        return 0;
 err_epc_mem_exit:
        pci_epc_mem_exit(epc);