]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: apple: Follow the PCIe specifications when resetting the port
authorMarc Zyngier <maz@kernel.org>
Tue, 23 Nov 2021 18:06:34 +0000 (18:06 +0000)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 7 Dec 2021 16:37:31 +0000 (10:37 -0600)
commit9b5be756a378e3252b7b5474c55bac7d23a1f6f3
treefde81c377ef0beea9a9c2bafddc792fe5071289a
parent1c79c9db5e321a18522acd07ef1f9e3a39bfe7da
PCI: apple: Follow the PCIe specifications when resetting the port

While the Apple PCIe driver works correctly when directly booted from the
firmware, it fails to initialise when the kernel is booted from a
bootloader using PCIe such as u-boot.

That's because we're missing a proper reset of the port (we only clear the
reset, but never assert it).

The PCIe spec requirements are two-fold:

  - PERST# must be asserted before setting up the clocks and stay asserted
    for at least 100us (Tperst-clk)

  - Once PERST# is deasserted, the OS must wait for at least 100ms "from
    the end of a Conventional Reset" before we can start talking to the
    devices

Implementing this results in a booting system.

[bhelgaas: #PERST -> PERST#, update spec references to current]
Fixes: c20870b4ee0c ("PCI: apple: Add initial hardware bring-up")
Link: https://lore.kernel.org/r/20211123180636.80558-2-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>
Acked-by: Pali Rohár <pali@kernel.org>
Cc: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
drivers/pci/controller/pcie-apple.c