Skip to content

Commit 215d4b0

Browse files
bmuddebipcolberg
authored andcommitted
fpga: dfl: Add support for DFH Private feature type
Allow a Device Feature List (DFL) to start with a Device Feature Header (DFH) of type Private feature in addition to the currently supported type, Feature Management Entity (FME) or Port. Signed-off-by: Basheer Ahmed Muddebihal <basheer.ahmed.muddebihal@linux.intel.com>
1 parent 275926c commit 215d4b0

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

drivers/fpga/dfl-pci.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,11 @@ static int find_dfls_by_default(struct pci_dev *pcidev,
308308
start = pci_resource_start(pcidev, 0);
309309
len = pci_resource_len(pcidev, 0);
310310

311+
dfl_fpga_enum_info_add_dfl(info, start, len);
312+
} else if (dfl_feature_is_private(base)) {
313+
start = pci_resource_start(pcidev, 0);
314+
len = pci_resource_len(pcidev, 0);
315+
311316
dfl_fpga_enum_info_add_dfl(info, start, len);
312317
} else {
313318
v = readq(base + DFH);

drivers/fpga/dfl.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,13 @@ static inline bool dfl_feature_is_port(void __iomem *base)
495495
(FIELD_GET(DFH_ID, v) == DFH_ID_FIU_PORT);
496496
}
497497

498+
static inline bool dfl_feature_is_private(void __iomem *base)
499+
{
500+
u64 v = readq(base + DFH);
501+
502+
return (FIELD_GET(DFH_TYPE, v) == DFH_TYPE_PRIVATE);
503+
}
504+
498505
static inline u8 dfl_feature_revision(void __iomem *base)
499506
{
500507
return (u8)FIELD_GET(DFH_REVISION, readq(base + DFH));

0 commit comments

Comments
 (0)