Unverified Commit 87a9d0cd authored by Manivannan Sadhasivam's avatar Manivannan Sadhasivam Committed by Krzysztof Wilczyński
Browse files

PCI: dwc: Pass DWC PCIe mode to dwc_pcie_debugfs_init()



Upcoming PTM debugfs interface relies on the DWC PCIe mode to expose the
relevant debugfs attributes to userspace. So pass the mode to
dwc_pcie_debugfs_init() API from host and ep drivers and save it in
'struct dw_pcie::mode'.

Signed-off-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: default avatarKrzysztof Wilczyński <kwilczynski@kernel.org>
Link: https://patch.msgid.link/20250505-pcie-ptm-v4-2-02d26d51400b@linaro.org
parent 13283340
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -651,7 +651,7 @@ void dwc_pcie_debugfs_deinit(struct dw_pcie *pci)
	debugfs_remove_recursive(pci->debugfs->debug_dir);
}

void dwc_pcie_debugfs_init(struct dw_pcie *pci)
void dwc_pcie_debugfs_init(struct dw_pcie *pci, enum dw_pcie_device_mode mode)
{
	char dirname[DWC_DEBUGFS_BUF_MAX];
	struct device *dev = pci->dev;
@@ -674,4 +674,6 @@ void dwc_pcie_debugfs_init(struct dw_pcie *pci)
			err);

	dwc_pcie_ltssm_debugfs_init(pci, dir);

	pci->mode = mode;
}
+1 −1
Original line number Diff line number Diff line
@@ -1013,7 +1013,7 @@ int dw_pcie_ep_init_registers(struct dw_pcie_ep *ep)

	dw_pcie_ep_init_non_sticky_registers(pci);

	dwc_pcie_debugfs_init(pci);
	dwc_pcie_debugfs_init(pci, DW_PCIE_EP_TYPE);

	return 0;

+1 −1
Original line number Diff line number Diff line
@@ -567,7 +567,7 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp)
	if (pp->ops->post_init)
		pp->ops->post_init(pp);

	dwc_pcie_debugfs_init(pci);
	dwc_pcie_debugfs_init(pci, DW_PCIE_RC_TYPE);

	return 0;

+4 −2
Original line number Diff line number Diff line
@@ -503,6 +503,7 @@ struct dw_pcie {
	struct gpio_desc		*pe_rst;
	bool			suspended;
	struct debugfs_info	*debugfs;
	enum			dw_pcie_device_mode mode;

	/*
	 * If iATU input addresses are offset from CPU physical addresses,
@@ -871,10 +872,11 @@ dw_pcie_ep_get_func_from_ep(struct dw_pcie_ep *ep, u8 func_no)
#endif

#ifdef CONFIG_PCIE_DW_DEBUGFS
void dwc_pcie_debugfs_init(struct dw_pcie *pci);
void dwc_pcie_debugfs_init(struct dw_pcie *pci, enum dw_pcie_device_mode mode);
void dwc_pcie_debugfs_deinit(struct dw_pcie *pci);
#else
static inline void dwc_pcie_debugfs_init(struct dw_pcie *pci)
static inline void dwc_pcie_debugfs_init(struct dw_pcie *pci,
					 enum dw_pcie_device_mode mode)
{
}
static inline void dwc_pcie_debugfs_deinit(struct dw_pcie *pci)