PCI: dwc: ep: Enforce DWC specific 64-bit BAR limitation
authorNiklas Cassel <cassel@kernel.org>
Tue, 28 May 2024 13:48:40 +0000 (15:48 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 9 Jul 2024 23:21:39 +0000 (18:21 -0500)
commit9b10e877fc847f161aa4e6c918799002ad6dad23
treea1cccc5f624294c1235b8b4b3649522fe2b8664f
parentb8747e10fde9573834b9f320593422e37af1af97
PCI: dwc: ep: Enforce DWC specific 64-bit BAR limitation

From the DWC EP databook 5.96a, section "3.5.7.1.4 General Rules for BAR
Setup (Fixed Mask or Programmable Mask Schemes Only)":

"Any pair (for example BARs 0 and 1) can be configured as one 64-bit BAR,
two 32-bit BARs, or one 32-bit BAR."

"BAR pairs cannot overlap to form a 64-bit BAR. For example, you cannot
combine BARs 1 and 2 to form a 64-bit BAR."

While this limitation does exist in some other PCI endpoint controllers,
e.g. cdns_pcie_ep_set_bar(), the limitation does not appear to be defined
in the PCIe specification itself, thus add an explicit check for this in
dw_pcie_ep_set_bar() (rather than pci_epc_set_bar()).

Link: https://lore.kernel.org/linux-pci/20240528134839.8817-2-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Krzysztof WilczyƄski <kwilczynski@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
drivers/pci/controller/dwc/pcie-designware-ep.c