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: 848555 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KzTlmowQ"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yyFGd011Bz9s7g for ; Fri, 15 Dec 2017 00:46:49 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752766AbdLNNqq (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-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org 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)