Skip to content

Commit

Permalink
Merge branch 'pci/controller/cadence'
Browse files Browse the repository at this point in the history
- Configure endpoint BAR to be 64-bit if the PCI_BASE_ADDRESS_MEM_TYPE_64
  flag is set instead of depending on the new BAR value itself (Niklas
  Cassel)

* pci/controller/cadence:
  PCI: cadence: Set a 64-bit BAR if requested
  • Loading branch information
bjorn-helgaas committed May 16, 2024
2 parents 14680b2 + 07db0fa commit ec54985
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/pci/controller/cadence/pcie-cadence-ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,11 @@ static int cdns_pcie_ep_set_bar(struct pci_epc *epc, u8 fn, u8 vfn,
ctrl = CDNS_PCIE_LM_BAR_CFG_CTRL_IO_32BITS;
} else {
bool is_prefetch = !!(flags & PCI_BASE_ADDRESS_MEM_PREFETCH);
bool is_64bits = sz > SZ_2G;
bool is_64bits = !!(flags & PCI_BASE_ADDRESS_MEM_TYPE_64);

if (is_64bits && (bar & 1))
return -EINVAL;

if (is_64bits && !(flags & PCI_BASE_ADDRESS_MEM_TYPE_64))
epf_bar->flags |= PCI_BASE_ADDRESS_MEM_TYPE_64;

if (is_64bits && is_prefetch)
ctrl = CDNS_PCIE_LM_BAR_CFG_CTRL_PREFETCH_MEM_64BITS;
else if (is_prefetch)
Expand Down

0 comments on commit ec54985

Please sign in to comment.