Skip to content

Commit 3291060

Browse files
edimoldovanclaude
andcommitted
PCI: apple: make an adopted port's DART available
Once a port is adopted, trained by the bootloader or by Linux, the root complex is up: make the port's DART available. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent dbd43f4 commit 3291060

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎drivers/pci/controller/pcie-apple.c‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2183,6 +2183,18 @@ static int apple_pcie_t6050_shared_phy_on(struct apple_pcie *pcie)
21832183
return 0;
21842184
}
21852185

2186+
/* The port's DART answers once the root complex is up (apple,manual-availability) */
2187+
static void apple_pcie_dart_available(struct apple_pcie_port *port)
2188+
{
2189+
struct of_phandle_args iommu = {};
2190+
2191+
if (of_map_iommu_id(port->pcie->dev->of_node, port->adopted_bus << 8, &iommu) ||
2192+
!iommu.np)
2193+
return;
2194+
apple_dart_make_available(iommu.np);
2195+
of_node_put(iommu.np);
2196+
}
2197+
21862198
static int apple_pcie_t6050_cold_train(struct apple_pcie_port *port)
21872199
{
21882200
struct apple_pcie *pcie = port->pcie;
@@ -2568,6 +2580,7 @@ static int apple_pcie_setup_port(struct apple_pcie *pcie,
25682580
}
25692581
if (ret)
25702582
goto err_teardown;
2583+
apple_pcie_dart_available(port);
25712584
} else {
25722585
if (pcie->hw->retain_clocks)
25732586
rmw_set(PORT_APPCLK_EN, port->base + PORT_APPCLK);

0 commit comments

Comments
 (0)