Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1213084pxa; Thu, 20 Aug 2020 05:50:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysYioEh/jD3LIb3GZJ7q1bzt+3dl2xWNeo4u66vyZobP9tqWa3Mm3HbxgNxqY2fMTqO3lO X-Received: by 2002:a17:906:b052:: with SMTP id bj18mr2484436ejb.131.1597927819340; Thu, 20 Aug 2020 05:50:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597927819; cv=none; d=google.com; s=arc-20160816; b=mbOS3WTLDnhszKiKWoY2cwb9mQXJ8bYD0Gud33o2z3Zpg0cUR2JFTG4oaCEzNry91Q CY+V5S63fRcm8xJcl+q9Dq78rCjthdAQ7SAVslWbBZ87qnv+uVZC5iaz3b4ysTLkOHaC WblSHK2dferLjJMmVcyt8RDGCAH6QDbS2OeBH3OgEiZViSyaCKJi0hbBBlYbeYnDQpDO KQevDDeLtGxI5qld5hImwmllJG/jMM1ObwhH/Unfm11BuVsVJU9yrjS3YxgH2vmAliFe Dx5T6pJdMMwE/KjnFc3yhmz1bacvMk2zYhJVdt0OGRNHQG/68D2jhD+7Sg6uFI7MTT19 5m2Q== 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=fR6bEIoZc+FhtZiICbALoDJ4gASSu9JJ36n1yz5+fcwAwG4W2bwQpCgt5Izb1ukh0R liWL+u5CyQUl3o9qLByM9iaUL5qPav7UycrQpPoIWpTIO45Q+uYV5V25lDaT9Bidci2r gN4Xz6KFmg0QXECSKpll//ry7dH1RiMSlPowfo6lm6glvkwxI9R8gAJC3Z4Hu84vja0q mB/lBL4rcGpVb1qP6eHp2SN/7kyUEL4dZvDf341YumhuYqzkCU3lxnxCTJngz/vMD5yI fBaXpDKeJVNhxSKoHVg4GP9m7fYVqA8JBX0KQTRA1GahZ/heU6yUTXXqUuhZIUwOX+uY S+Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="0R89/UlM"; 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 w22si1092188eju.155.2020.08.20.05.49.55; Thu, 20 Aug 2020 05:50:19 -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="0R89/UlM"; 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 S1729214AbgHTMr0 (ORCPT + 99 others); Thu, 20 Aug 2020 08:47:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:46380 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729213AbgHTJp3 (ORCPT ); Thu, 20 Aug 2020 05:45:29 -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 4F79022D6D; Thu, 20 Aug 2020 09:44:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597916696; bh=4Pu5l+a7R0giKXEjk93F4XnVBL48zhHRz7T5g0HZRQc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0R89/UlMfCk1dw0PXngaU+kvwFjI8T7lm3yTcsj++RqxW+18v3lKVZnxyu41wx6gk PP6gh1QcxrX6kyWBlgqJu1z/TcM1Wu9JREIxb3CTYNtSq6iFurBLwXyKvX6f4HjVoL Ufo1sz0QI9YdyNK/ffeaWd4j74M9Q2eOpkyotqdE= 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 5.4 007/152] PCI: qcom: Define some PARF params needed for ipq8064 SoC Date: Thu, 20 Aug 2020 11:19:34 +0200 Message-Id: <20200820091554.011441096@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091553.615456912@linuxfoundation.org> References: <20200820091553.615456912@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);