Skip to content

Commit f4036f6

Browse files
committed
Merge branch 'pci/controller/rockchip'
- 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) - Set Subsystem Vendor ID correctly (Rick Wertenbroek) * pci/controller/rockchip: PCI: rockchip-ep: Remove wrong mask on subsys_vendor_id PCI: rockchip-ep: Set a 64-bit BAR if requested
2 parents 102c696 + 2dba285 commit f4036f6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/pci/controller/pcie-rockchip-ep.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,8 @@ static int rockchip_pcie_ep_write_header(struct pci_epc *epc, u8 fn, u8 vfn,
9898

9999
/* All functions share the same vendor ID with function 0 */
100100
if (fn == 0) {
101-
u32 vid_regs = (hdr->vendorid & GENMASK(15, 0)) |
102-
(hdr->subsys_vendor_id & GENMASK(31, 16)) << 16;
103-
104-
rockchip_pcie_write(rockchip, vid_regs,
101+
rockchip_pcie_write(rockchip,
102+
hdr->vendorid | hdr->subsys_vendor_id << 16,
105103
PCIE_CORE_CONFIG_VENDOR);
106104
}
107105

@@ -153,7 +151,7 @@ static int rockchip_pcie_ep_set_bar(struct pci_epc *epc, u8 fn, u8 vfn,
153151
ctrl = ROCKCHIP_PCIE_CORE_BAR_CFG_CTRL_IO_32BITS;
154152
} else {
155153
bool is_prefetch = !!(flags & PCI_BASE_ADDRESS_MEM_PREFETCH);
156-
bool is_64bits = sz > SZ_2G;
154+
bool is_64bits = !!(flags & PCI_BASE_ADDRESS_MEM_TYPE_64);
157155

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

0 commit comments

Comments
 (0)