Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1680728imu; Wed, 12 Dec 2018 02:23:15 -0800 (PST) X-Google-Smtp-Source: AFSGD/VRe8dIT2QYw+1NDDNEDGsQb0RRxrlEHMxfH9xpDZEuMC2U7DGqbEYAd5qPelmn8ZwPD6eX X-Received: by 2002:a62:444b:: with SMTP id r72mr20059745pfa.184.1544610195154; Wed, 12 Dec 2018 02:23:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544610195; cv=none; d=google.com; s=arc-20160816; b=q1k0+d7i9K5yN9p39N4mjKbHlfGzxXA0XJ5so/MT/OnNhlvqJrseDE0I191M/FviA1 3JG60V/d5TiAfIYjNMJFl8cwZsIbyfrfOUig2kFIPjCOEsF1q8MAOu4PG0hrwzITn4DU v3hHCaQqcFtV9wj78uGTixuoCOxV5kpqUW6wzQEkqNrI2N/hlYzApXY049Lbp73w1S8/ SnhMErUDqfAsTLIvwf1svcJRctJgptaHeE08R5XwsQ+o6b2bmgXsmEegKjbrF8oLoCNt 9SlrzB+V7ARfrt1XWVwiG9s9a7ERux9m7fQQUkgTxTJeeoZ/BZzYHzy3p5q9Dfwmlcu6 agMw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Fm/BGZEtlC5DjDBsUGzBc0mISD6rDUYWGPuGh5Z9dK0=; b=iMtlgD0zBBfpACdmjgYeaQP5nzM4tisk8OulbBuyfaUMJ4t/pxMe8mofLiSyNHNW/P pLq0M/smGzx9+CFpvKesS/5Mpbl3V5E+RfaGvyeyv5HyxQPcqNmW06xJdOkAr63b6KUX 0H2zbYbrVHwj3UX+h+88wx20Zj/1MxcTtiZggr+8eoyRcJDWxFZdGuOSsiunnAGGuBKN qjy3AY5g644WXUyaaPPV3XBZyvkbdE/LTtX2AJMNb/cPPXw2VBSFyYPRA2RZO2S3IM0o 2QpmUcUO5U9sgMimUkXV2Om/rmlKS3jT1e2zvZF9/uXEw8m6MC28YRjoHRrY/GM9ly5S gYUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h9si15208670pli.418.2018.12.12.02.23.00; Wed, 12 Dec 2018 02:23:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727139AbeLLKWB (ORCPT + 99 others); Wed, 12 Dec 2018 05:22:01 -0500 Received: from mail.bootlin.com ([62.4.15.54]:57451 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726869AbeLLKV5 (ORCPT ); Wed, 12 Dec 2018 05:21:57 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id A3F6A20D92; Wed, 12 Dec 2018 11:21:54 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.2 Received: from localhost.localdomain (aaubervilliers-681-1-89-7.w90-88.abo.wanadoo.fr [90.88.30.7]) by mail.bootlin.com (Postfix) with ESMTPSA id 3328E20734; Wed, 12 Dec 2018 11:21:44 +0100 (CET) From: Miquel Raynal To: Gregory Clement , Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Thomas Petazzoni , Bjorn Helgaas Cc: , Rob Herring , Mark Rutland , Lorenzo Pieralisi , linux-pci@vger.kernel.org, , , Antoine Tenart , Maxime Chevallier , Nadav Haklai , Miquel Raynal Subject: [PATCH v2 01/12] PCI: aardvark: Configure more registers in the configuration helper Date: Wed, 12 Dec 2018 11:21:31 +0100 Message-Id: <20181212102142.16053-2-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181212102142.16053-1-miquel.raynal@bootlin.com> References: <20181212102142.16053-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mimic U-Boot configuration to be sure all hardware registers are set properly. This will be needed for future S2RAM operation. Signed-off-by: Miquel Raynal --- drivers/pci/controller/pci-aardvark.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c index 750081c1cb48..b95eb2aa00bb 100644 --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c @@ -100,6 +100,8 @@ #define PCIE_CORE_CTRL2_STRICT_ORDER_ENABLE BIT(5) #define PCIE_CORE_CTRL2_OB_WIN_ENABLE BIT(6) #define PCIE_CORE_CTRL2_MSI_ENABLE BIT(10) +#define PCIE_PHY_REFCLK (CONTROL_BASE_ADDR + 0x14) +#define PCIE_PHY_REFCLK_BUF_CTRL 0x1342 #define PCIE_MSG_LOG_REG (CONTROL_BASE_ADDR + 0x30) #define PCIE_ISR0_REG (CONTROL_BASE_ADDR + 0x40) #define PCIE_MSG_PM_PME_MASK BIT(7) @@ -243,6 +245,9 @@ static void advk_pcie_setup_hw(struct advk_pcie *pcie) { u32 reg; + /* Set HW Reference Clock Buffer Control */ + advk_writel(pcie, PCIE_PHY_REFCLK_BUF_CTRL, PCIE_PHY_REFCLK); + /* Set to Direct mode */ reg = advk_readl(pcie, CTRL_CONFIG_REG); reg &= ~(CTRL_MODE_MASK << CTRL_MODE_SHIFT); @@ -274,6 +279,15 @@ static void advk_pcie_setup_hw(struct advk_pcie *pcie) PCIE_CORE_CTRL2_TD_ENABLE; advk_writel(pcie, reg, PCIE_CORE_CTRL2_REG); + /* Set PCIe Device Control and Status 1 PF0 register */ + reg = PCIE_CORE_DEV_CTRL_STATS_RELAX_ORDER_DISABLE | + PCIE_CORE_DEV_CTRL_STATS_SNOOP_DISABLE; + advk_writel(pcie, reg, PCIE_CORE_DEV_CTRL_STATS_REG); + + /* Program PCIe Control 2 to disable strict ordering */ + reg = PCIE_CORE_CTRL2_RESERVED | PCIE_CORE_CTRL2_TD_ENABLE; + advk_writel(pcie, reg, PCIE_CORE_CTRL2_REG); + /* Set GEN2 */ reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG); reg &= ~PCIE_GEN_SEL_MSK; -- 2.19.1