]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
PCI: rockchip: Fix window mapping and address translation for endpoint
authorRick Wertenbroek <rick.wertenbroek@gmail.com>
Tue, 18 Apr 2023 07:46:55 +0000 (09:46 +0200)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Mon, 2 Oct 2023 15:20:45 +0000 (17:20 +0200)
commitbf726c6ee665ed2496f36d4021a7d97edcc7096d
treea3d3ff3f23fff2461d4d99182882863ad051ae7a
parent49fc4845243d59b3c451479d94d78ba8cea39f07
PCI: rockchip: Fix window mapping and address translation for endpoint

BugLink: https://bugs.launchpad.net/bugs/2037005
[ Upstream commit dc73ed0f1b8bddd7f2bf70d123e68ffc99ad71ce ]

The RK3399 PCI endpoint core has 33 windows for PCIe space, now in the
driver up to 32 fixed size (1M) windows are used and pages are allocated
and mapped accordingly. The driver first used a single window and allocated
space inside which caused translation issues (between CPU space and PCI
space) because a window can only have a single translation at a given
time, which if multiple pages are allocated inside will cause conflicts.
Now each window is a single region of 1M which will always guarantee that
the translation is not in conflict.

Set the translation register addresses for physical function. As documented
in the technical reference manual (TRM) section 17.5.5 "PCIe Address
Translation" and section 17.6.8 "Address Translation Registers Description"

Link: https://lore.kernel.org/r/20230418074700.1083505-9-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
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
drivers/pci/controller/pcie-rockchip-ep.c
drivers/pci/controller/pcie-rockchip.h