Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 34ed10ae authored by Yan He's avatar Yan He
Browse files

msm: pcie: add logging for PCIe reset



PCIe reset (PERST) is very important to sync up with PCIe endpoint
side. Thus, add this logging and enable it by default in the kernel
log, which will significantly help debug on both APQ and MDM sides.

Change-Id: Ib8da7d2e18c26ba581dcc645e88392d396083f65
Signed-off-by: default avatarYan He <yanhe@codeaurora.org>
parent 96572b8c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -900,6 +900,7 @@ static int msm_pcie_enable(struct msm_pcie_dev_t *dev, u32 options)

	/* assert PCIe reset link to keep EP in reset */

	pr_info("PCIe: Assert the reset of endpoint\n");
	gpio_set_value(dev->gpio[MSM_PCIE_GPIO_PERST].num,
				dev->gpio[MSM_PCIE_GPIO_PERST].on);
	usleep_range(PERST_PROPAGATION_DELAY_US_MIN,
@@ -960,6 +961,7 @@ static int msm_pcie_enable(struct msm_pcie_dev_t *dev, u32 options)

	/* de-assert PCIe reset link to bring EP out of reset */

	pr_info("PCIe: Release the reset of endpoint\n");
	gpio_set_value(dev->gpio[MSM_PCIE_GPIO_PERST].num,
				1 - dev->gpio[MSM_PCIE_GPIO_PERST].on);
	usleep_range(PERST_PROPAGATION_DELAY_US_MIN,
@@ -994,6 +996,7 @@ static int msm_pcie_enable(struct msm_pcie_dev_t *dev, u32 options)
	if (val & XMLH_LINK_UP) {
		pr_info("PCIe link initialized\n");
	} else {
		pr_info("PCIe: Assert the reset of endpoint\n");
		gpio_set_value(dev->gpio[MSM_PCIE_GPIO_PERST].num,
			dev->gpio[MSM_PCIE_GPIO_PERST].on);
		pr_err("PCIe link initialization failed\n");
@@ -1028,6 +1031,7 @@ void msm_pcie_disable(struct msm_pcie_dev_t *dev, u32 options)
{
	PCIE_DBG("\n");

	pr_info("PCIe: Assert the reset of endpoint\n");
	gpio_set_value(dev->gpio[MSM_PCIE_GPIO_PERST].num,
				dev->gpio[MSM_PCIE_GPIO_PERST].on);