File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
drivers/pci/controller/cadence Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -565,14 +565,26 @@ static int cdns_pcie_ep_start(struct pci_epc *epc)
565
565
struct cdns_pcie * pcie = & ep -> pcie ;
566
566
struct device * dev = pcie -> dev ;
567
567
int max_epfs = sizeof (epc -> function_num_map ) * 8 ;
568
- int ret , value , epf ;
568
+ int ret , epf , last_fn ;
569
+ u32 reg , value ;
569
570
570
571
/*
571
572
* BIT(0) is hardwired to 1, hence function 0 is always enabled
572
573
* and can't be disabled anyway.
573
574
*/
574
575
cdns_pcie_writel (pcie , CDNS_PCIE_LM_EP_FUNC_CFG , epc -> function_num_map );
575
576
577
+ /*
578
+ * Next function field in ARI_CAP_AND_CTR register for last function
579
+ * should be 0.
580
+ * Clearing Next Function Number field for the last function used.
581
+ */
582
+ last_fn = find_last_bit (& epc -> function_num_map , BITS_PER_LONG );
583
+ reg = CDNS_PCIE_CORE_PF_I_ARI_CAP_AND_CTRL (last_fn );
584
+ value = cdns_pcie_readl (pcie , reg );
585
+ value &= ~CDNS_PCIE_ARI_CAP_NFN_MASK ;
586
+ cdns_pcie_writel (pcie , reg , value );
587
+
576
588
if (ep -> quirk_disable_flr ) {
577
589
for (epf = 0 ; epf < max_epfs ; epf ++ ) {
578
590
if (!(epc -> function_num_map & BIT (epf )))
Original file line number Diff line number Diff line change 130
130
#define CDNS_PCIE_EP_FUNC_DEV_CAP_OFFSET 0xc0
131
131
#define CDNS_PCIE_EP_FUNC_SRIOV_CAP_OFFSET 0x200
132
132
133
+ /*
134
+ * Endpoint PF Registers
135
+ */
136
+ #define CDNS_PCIE_CORE_PF_I_ARI_CAP_AND_CTRL (fn ) (0x144 + (fn) * 0x1000)
137
+ #define CDNS_PCIE_ARI_CAP_NFN_MASK GENMASK(15, 8)
138
+
133
139
/*
134
140
* Root Port Registers (PCI configuration space for the root port function)
135
141
*/
You can’t perform that action at this time.
0 commit comments