Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1200226pxa; Thu, 20 Aug 2020 05:28:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4M5ULXLrG/CzcV0o31cQuhYPfi5xwdqNyYwoRloneTM+uwtbWZQ9OpwvvulkPxMwsCABd X-Received: by 2002:a17:906:85da:: with SMTP id i26mr1368179ejy.458.1597926523147; Thu, 20 Aug 2020 05:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597926523; cv=none; d=google.com; s=arc-20160816; b=OHb+e+rta9pp9AijkvGQVS1BPi3YcILNJ+eChBQxqiWOMVHGmLCkIxUOEYLgMBX0a8 AtzP3LJNKgBvM6uJqvglG1m+glaFkqxEhJQlYz6hMxAdezBCmzLaddtSZwntNmm92gfm iw8VP4y8fwy7+zH3nIPnfH/ZGVIM3SVyk3+OOV8Jh7B0gdu9hCZVgqlWtzcvEDzxJ5lr ZWilZG7EFpnznz3qCu1tjPK1iqIWYv4TRSUgVe99lPCPYtBm9J4NkB0OgG1JZ7NQURgJ QwhNmfRxvCmjp0PgyoacJWtnpRNH05p6V8TBgCVh7ZywxxHyorOH27NhR9DMQZ0ScMEG IWcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eB49yb+4WGuKRxRxz6GwjOtnALLF2KPCTcJk6TBNctE=; b=ewBYlcPlz2baClPpR39e3je7No3qK0t+5wBEFh6nELtqKZvDAjjPxDoDBPyj8LnQRK ZpQmKmzKx4fep2a02bt1rOJVZ3HqBnJTO7lCKMR0XVUiCtvvVGwUls3uAj1pGnR2aMVF qOHkD00iJO5wdU/onMgCXgznSfaqsTn5B+VMLOeqoIEhKidEu/ZN/i6wtCEvgQSTyoxz 13AiZRur9V0fPkV7nM3dtRjop4KrvFDQGlimy0U4wmiMtqQCvGIw13Z8we6FWEsKyJiy 59ey54qSRCzlMxSyzupI8eUNR6EnqVz/JriI9iXBbSKy1tKqdGSqecI7ut9LbFcL7hBR WfNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ISOzYfSN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pk23si1122450ejb.488.2020.08.20.05.28.18; Thu, 20 Aug 2020 05:28:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ISOzYfSN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729924AbgHTM1s (ORCPT + 99 others); Thu, 20 Aug 2020 08:27:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:33346 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729886AbgHTJwL (ORCPT ); Thu, 20 Aug 2020 05:52:11 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 17E7B2067C; Thu, 20 Aug 2020 09:52:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597917130; bh=4Pu5l+a7R0giKXEjk93F4XnVBL48zhHRz7T5g0HZRQc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ISOzYfSNrkFfOc7y/K4v97ZM+k8CV1Et3Zgw4dk1Gwd+KMzJxOuS5ozBHZr6/vIur mfLHN/PgIXQVfpvFwJEFtpcSuAaOgUFF/JFn16mr1lcYQ3V0pX+bQXK/b4Bpjm+/Nv VoZGa0IVIi+51ejT7r0PMupWBhOszhPg6FL3JPY4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ansuel Smith , Lorenzo Pieralisi , Rob Herring , Stanimir Varbanov Subject: [PATCH 4.19 06/92] PCI: qcom: Define some PARF params needed for ipq8064 SoC Date: Thu, 20 Aug 2020 11:20:51 +0200 Message-Id: <20200820091537.825524967@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091537.490965042@linuxfoundation.org> References: <20200820091537.490965042@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ansuel Smith commit 5149901e9e6deca487c01cc434a3ac4125c7b00b upstream. Set some specific value for Tx De-Emphasis, Tx Swing and Rx equalization needed on some ipq8064 based device (Netgear R7800 for example). Without this the system locks on kernel load. Link: https://lore.kernel.org/r/20200615210608.21469-8-ansuelsmth@gmail.com Fixes: 82a823833f4e ("PCI: qcom: Add Qualcomm PCIe controller driver") Signed-off-by: Ansuel Smith Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring Acked-by: Stanimir Varbanov Cc: stable@vger.kernel.org # v4.5+ Signed-off-by: Greg Kroah-Hartman --- drivers/pci/controller/dwc/pcie-qcom.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -76,6 +76,18 @@ #define DBI_RO_WR_EN 1 #define PERST_DELAY_US 1000 +/* PARF registers */ +#define PCIE20_PARF_PCS_DEEMPH 0x34 +#define PCS_DEEMPH_TX_DEEMPH_GEN1(x) ((x) << 16) +#define PCS_DEEMPH_TX_DEEMPH_GEN2_3_5DB(x) ((x) << 8) +#define PCS_DEEMPH_TX_DEEMPH_GEN2_6DB(x) ((x) << 0) + +#define PCIE20_PARF_PCS_SWING 0x38 +#define PCS_SWING_TX_SWING_FULL(x) ((x) << 8) +#define PCS_SWING_TX_SWING_LOW(x) ((x) << 0) + +#define PCIE20_PARF_CONFIG_BITS 0x50 +#define PHY_RX0_EQ(x) ((x) << 24) #define PCIE20_v3_PARF_SLV_ADDR_SPACE_SIZE 0x358 #define SLV_ADDR_SPACE_SZ 0x10000000 @@ -275,6 +287,7 @@ static int qcom_pcie_init_2_1_0(struct q struct qcom_pcie_resources_2_1_0 *res = &pcie->res.v2_1_0; struct dw_pcie *pci = pcie->pci; struct device *dev = pci->dev; + struct device_node *node = dev->of_node; u32 val; int ret; @@ -319,6 +332,17 @@ static int qcom_pcie_init_2_1_0(struct q val &= ~BIT(0); writel(val, pcie->parf + PCIE20_PARF_PHY_CTRL); + if (of_device_is_compatible(node, "qcom,pcie-ipq8064")) { + writel(PCS_DEEMPH_TX_DEEMPH_GEN1(24) | + PCS_DEEMPH_TX_DEEMPH_GEN2_3_5DB(24) | + PCS_DEEMPH_TX_DEEMPH_GEN2_6DB(34), + pcie->parf + PCIE20_PARF_PCS_DEEMPH); + writel(PCS_SWING_TX_SWING_FULL(120) | + PCS_SWING_TX_SWING_LOW(120), + pcie->parf + PCIE20_PARF_PCS_SWING); + writel(PHY_RX0_EQ(4), pcie->parf + PCIE20_PARF_CONFIG_BITS); + } + /* enable external reference clock */ val = readl(pcie->parf + PCIE20_PARF_PHY_REFCLK); val |= BIT(16);