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

Commit 96ff3c62 authored by Siva Kumar Akkireddi's avatar Siva Kumar Akkireddi
Browse files

msm: ep_pcie: Move tcsr perst delatch before link-up check



The tcsr perst delatch is done before the link-up check in
ep_pcie_core_enable_endpoint to ensure it happens even in
the bios-locking case.

Change-Id: Ife595c7e49175b71f38087dea29ee521bf1c58c7
Signed-off-by: default avatarSiva Kumar Akkireddi <sivaa@codeaurora.org>
parent 22b0c562
Loading
Loading
Loading
Loading
+17 −16
Original line number Diff line number Diff line
/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1360,6 +1360,21 @@ int ep_pcie_core_enable_endpoint(enum ep_pcie_options opt)
		}

		dev->power_on = true;

		 EP_PCIE_DBG(dev,
			 "TCSR PERST_EN value before configure:0x%x\n",
			 readl_relaxed(dev->tcsr_perst_en + 0x258));

		 /*
		  * Delatch PERST_EN with TCSR to avoid device reset
		  * during host reboot case.
		  */
		 writel_relaxed(0, dev->tcsr_perst_en + 0x258);

		 EP_PCIE_DBG(dev,
			 "TCSR PERST_EN value after configure:0x%x\n",
			 readl_relaxed(dev->tcsr_perst_en));

		 /* check link status during initial bootup */
		if (!dev->enumerated) {
			val = readl_relaxed(dev->parf + PCIE20_PARF_PM_STTS);
@@ -1400,20 +1415,6 @@ int ep_pcie_core_enable_endpoint(enum ep_pcie_options opt)
	if (!(opt & EP_PCIE_OPT_ENUM))
		goto out;

	EP_PCIE_DBG(dev,
		"TCSR PERST_EN value before configure:0x%x\n",
		readl_relaxed(dev->tcsr_perst_en + 0x258));

	/*
	 * Delatch PERST_EN with TCSR to avoid device reset
	 * during host reboot case.
	 */
	writel_relaxed(0, dev->tcsr_perst_en + 0x258);

	EP_PCIE_DBG(dev,
		"TCSR PERST_EN value after configure:0x%x\n",
		readl_relaxed(dev->tcsr_perst_en));

	if (opt & EP_PCIE_OPT_AST_WAKE) {
		/* assert PCIe WAKE# */
		EP_PCIE_INFO(dev, "PCIe V%d: assert PCIe WAKE#.\n",