arm: a37xx: pci: Fix configuring PCIe resources
authorPali Rohár <pali@kernel.org>
Wed, 26 May 2021 15:59:40 +0000 (17:59 +0200)
committerStefan Roese <sr@denx.de>
Fri, 4 Jun 2021 09:32:41 +0000 (11:32 +0200)
commitb321722f2215c5012194929d20f00d29ce8015be
treef5159ecb4d671006abe5c14e92e2741b3823a5e5
parent079b35a26111715043f1a144b10f5d313db36167
arm: a37xx: pci: Fix configuring PCIe resources

The `ranges` DT property of the PCIe node is currently ignored by
Aardvark driver - all entries are used as transparent PCIe MEM, despite
some of them being defined for IO in DT.

This is because the driver does not setup PCIe outbound windows and thus
a default configuration is used.

This can cause an external abort on CPU when a device driver tries to
access non-MEM space.

Setup the PCIe windows according to the `ranges` property for all
non-MEM resources (currently only IO) and also non-transparent MEM
resources.

Because Linux expects that bootloader does not setup Aardvark PCIe
windows, disable them before booting Linux.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
drivers/pci/pci-aardvark.c