Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions drivers/pci/controller/pcie-apple-cio.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ static void apple_pcie_cio_t6050_reset(struct apple_pcie *pcie, struct apple_pci
*/
static u32 apple_pcie_cio_t6050_pme_reg(void)
{
return of_machine_is_compatible("apple,j714s") ? PORT_T6050_PCIEC_PME_TURN_OFF :
return (of_machine_is_compatible("apple,j714s") ||
of_machine_is_compatible("apple,j716c")) ? PORT_T6050_PCIEC_PME_TURN_OFF :
PORT_PME_TURN_OFF;
}

Expand Down Expand Up @@ -387,7 +388,8 @@ static int apple_pcie_cio_suspend(struct apple_pcie *pcie)
u32 stat;
int i, ret, recover;

if (pcie->hw == &t6050_pciec_hw && of_machine_is_compatible("apple,j714s"))
if (pcie->hw == &t6050_pciec_hw && (of_machine_is_compatible("apple,j714s") ||
of_machine_is_compatible("apple,j716c")))
return apple_pcie_cio_suspend_t6050(pcie);
port = list_first_entry(&pcie->ports, struct apple_pcie_port, entry);
dev_info(pcie->dev, "CIO PCIe-C drain and reset\n");
Expand Down
14 changes: 9 additions & 5 deletions drivers/pci/controller/pcie-apple.c
Original file line number Diff line number Diff line change
Expand Up @@ -4312,7 +4312,8 @@ static int apple_pcie_tunnel_add_links(struct apple_pcie *pcie)
if (ret == -EOPNOTSUPP)
dev_warn(pcie->dev, "DART has no CIO sleep path; a docked deep sleep is refused\n");
} else if (cio_s2r && pcie->hw == &t6050_pciec_hw &&
of_machine_is_compatible("apple,j714s") &&
(of_machine_is_compatible("apple,j714s") ||
of_machine_is_compatible("apple,j716c")) &&
of_property_present(dart_pdev->dev.of_node, "apple,clock-protection")) {
/*
* TEST: T6050, a router that sleeps in place. Only with the DART's clock
Expand Down Expand Up @@ -5417,14 +5418,16 @@ static int apple_pcie_t6050_warm_reset(struct apple_pcie *pcie, bool noirq)
}

/*
* The adopted host's firmware sleep is set up on the board it has run on, the J714s. On another
* T6050 board nothing is registered and no port is taken for it: the host is as before.
* The adopted host's firmware sleep is set up on the boards with a T6050 sleep, the J714s and
* the J716c. On another T6050 board nothing is registered and no port is taken for it: the
* host is as before.
*/
static void apple_pcie_t6050_sleep_probe(struct platform_device *pdev, struct apple_pcie *pcie)
{
struct apple_pcie_port *port;

if (pcie->managed_sids || !of_machine_is_compatible("apple,j714s"))
if (pcie->managed_sids || !(of_machine_is_compatible("apple,j714s") ||
of_machine_is_compatible("apple,j716c")))
return;
/* The one port a boot loader trained; an endpoint Linux powers is parked instead. */
list_for_each_entry(port, &pcie->ports, entry)
Expand Down Expand Up @@ -7338,7 +7341,8 @@ static int apple_pcie_resume_noirq(struct device *dev)
* failed for it (run sv6t4: "PM: failed to resume noirq: error -107").
*/
if (ret == -ENOTCONN && pcie->cio_lost && pcie->hw == &t6050_pciec_hw &&
of_machine_is_compatible("apple,j714s")) {
(of_machine_is_compatible("apple,j714s") ||
of_machine_is_compatible("apple,j716c"))) {
dev_warn(dev, "T6050 sleep: PCIe-C tunnel gone with its dock during the sleep: the port is closed as after an unplug, its functions return when the dock is plugged in again\n");
return 0;
}
Expand Down
Loading