From patchwork Thu Dec 14 13:45:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 10112213 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0CF67603FA for ; Thu, 14 Dec 2017 13:46:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F23A6289A0 for ; Thu, 14 Dec 2017 13:46:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E740C28BA3; Thu, 14 Dec 2017 13:46:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A4E5289A0 for ; Thu, 14 Dec 2017 13:46:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752718AbdLNNqq (ORCPT ); Thu, 14 Dec 2017 08:46:46 -0500 Received: from mail-qk0-f195.google.com ([209.85.220.195]:46704 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752888AbdLNNpw (ORCPT ); Thu, 14 Dec 2017 08:45:52 -0500 Received: by mail-qk0-f195.google.com with SMTP id b184so6256417qkc.13; Thu, 14 Dec 2017 05:45:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jwtAZI/OXUgPcvCQ5VmN26UT+1uEyHPR34Tu/5g0/4Y=; b=KzTlmowQ+SbMIcMJQK8oi5gn6Zdkhz27WXwFEU/pu0bccfRVOWfv/jnJmZuWBheC+C oNsLPvV9lUS0j9IfWqknXTBrDc0mJnl5iFtOpm+1ZfqiqSF3SQa0++2wSFdClqAUoFEz 3sHcAJ3Qoyk/uyMpMb+F2kMmKp9/v+sUS/kUBrZX5Bi1GyFLuBr/lxaqt92mr/UKnGxs VKbDLH2HsWKskqO4X2HVm9LgtIWTUtz/a6ZIsibnk53TgXGwEc1VJpWqcfT0Dvh6/k69 QT5ou+MH80w1U+DTxqx8Alq6Q6Lq7WiZRMaOtY376YOTuv8iGyGqyTuidxjt6TxR05JD C7sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jwtAZI/OXUgPcvCQ5VmN26UT+1uEyHPR34Tu/5g0/4Y=; b=W05SD7ARtjJ2H+N7giLmlUXCndU30Z8TTXdPNzXka3PypBdOjGv+52cXa4SIt5VOSs wCWGk7j1nx7FR2M0ZWXbOkxnn3rRDjjr1faWvRpBIKpYDBFCyk6C41p19PZxNSU5h7sU X92zog9beMmR1vRzjnvD0IzcYO97sxaBMX5M9isgMSHIAYdzMbwXrD6mS+pyFaoB0rlB g0f6g3hjpvHUF3bX2rIFelMrNVvGJDbJ9h5y6b7CpMjbC38jIP+1IxiqPLKxB0vRlL/a X1JMo9NebB0sfENz2OgrwIPZFl7gyqM4I/fEVdqVYDr1/6oF8RMrYcgd9f1EgEv6v8iX IXnQ== X-Gm-Message-State: AKGB3mIC2ve0SIqoooenEwC/8f0RlxtLKYXuU+hSJhZ9qKIiYc1A3FJV 0vK8j3eOChYpI/D4fRkM13jLZQ== X-Google-Smtp-Source: ACJfBovmkVJOt3v52BvB3eZfvbtGqR7Y/9qEBeScWNoQ+oyv9bOezpFfbDwBL5PVkjgwFdZTkGjgNA== X-Received: by 10.55.191.135 with SMTP id p129mr16254917qkf.211.1513259151384; Thu, 14 Dec 2017 05:45:51 -0800 (PST) Received: from localhost (p200300E41F200F003F65F430A8AE2E44.dip0.t-ipconnect.de. [2003:e4:1f20:f00:3f65:f430:a8ae:2e44]) by smtp.gmail.com with ESMTPSA id y135sm2664594qka.48.2017.12.14.05.45.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Dec 2017 05:45:50 -0800 (PST) From: Thierry Reding To: Lorenzo Pieralisi , Bjorn Helgaas Cc: Jonathan Hunter , Vidya Saga , Manikanta Maddireddy , linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH 1/4] PCI: tegra: Clarify configuration space address computations Date: Thu, 14 Dec 2017 14:45:42 +0100 Message-Id: <20171214134545.11143-2-thierry.reding@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171214134545.11143-1-thierry.reding@gmail.com> References: <20171214134545.11143-1-thierry.reding@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding Tegra uses a non-compatible variant of ECAM where the extended register field is separate from the register field. Clarify that the register offset also factors into the computation of the configuration space addresses. Signed-off-by: Thierry Reding --- drivers/pci/host/pci-tegra.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c index f6d0430e6704..8a07c6f9e1b0 100644 --- a/drivers/pci/host/pci-tegra.c +++ b/drivers/pci/host/pci-tegra.c @@ -364,11 +364,13 @@ static inline u32 pads_readl(struct tegra_pcie *pcie, unsigned long offset) * * Mapping the whole extended configuration space would require 256 MiB of * virtual address space, only a small part of which will actually be used. - * To work around this, a 4K of region is used to generate required - * configuration transaction with relevant B:D:F values. This is achieved by - * dynamically programming base address and size of AFI_AXI_BAR used for - * end point config space mapping to make sure that the address (access to - * which generates correct config transaction) falls in this 4K region + * + * To work around this, a 4 KiB region is used to generate the required + * configuration transaction with relevant B:D:F and register offset values. + * This is achieved by dynamically programming base address and size of + * AFI_AXI_BAR used for end point config space mapping to make sure that the + * address (access to which generates correct config transaction) falls in + * this 4 KiB region. */ static unsigned long tegra_pcie_conf_offset(unsigned char b, unsigned int devfn, int where)