From patchwork Tue Aug 26 14:57:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 4782781 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AE1D4C0338 for ; Tue, 26 Aug 2014 14:58:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DAC4420114 for ; Tue, 26 Aug 2014 14:58:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D9A21200FE for ; Tue, 26 Aug 2014 14:58:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934507AbaHZO6A (ORCPT ); Tue, 26 Aug 2014 10:58:00 -0400 Received: from mail-we0-f176.google.com ([74.125.82.176]:59725 "EHLO mail-we0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934467AbaHZO55 (ORCPT ); Tue, 26 Aug 2014 10:57:57 -0400 Received: by mail-we0-f176.google.com with SMTP id q58so14812076wes.21 for ; Tue, 26 Aug 2014 07:57:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ejb+QLmrUXfglasYjejk6Hr0CZNX0WBKywF6VrngY5Q=; b=vL+saAttPC0JC76Qm5oQPZh3BQSjJC0xvejjm9ptqZzWjsdW6mj1naDNXVdvTMDgmb zORblFMiwDTlE1sCALzTkMu+k0kauo7q7/dkvKBJ6jTR8NlYtXgLKTLzzZfygHZOOK6s vhefDu3VLl0E4WxDLlrJpQIF76gdYyrKuw9LPyozZphYhDzcEg7Nu084z1BPrHUZ5kxY wCxqo+G4Ar7uokRHjm616OrFlwTorlixKAOq2xU0kv5oACApn1c2InWxA22zN5fIGWXW pwsA8355a0KehqFGAwJZJ0eR4BUKoZOPEHsjFqhlsGTmnaxZFp9uE/P6x91rZy4B5eE6 2NFg== X-Received: by 10.194.77.212 with SMTP id u20mr30877785wjw.27.1409065076170; Tue, 26 Aug 2014 07:57:56 -0700 (PDT) Received: from localhost (port-7111.pppoe.wtnet.de. [84.46.27.226]) by mx.google.com with ESMTPSA id u7sm3269056wif.7.2014.08.26.07.57.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Aug 2014 07:57:55 -0700 (PDT) From: Thierry Reding To: Bjorn Helgaas Cc: Stephen Warren , linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/6] PCI: tegra: Fix extended configuration space mapping Date: Tue, 26 Aug 2014 16:57:42 +0200 Message-Id: <1409065064-17617-5-git-send-email-thierry.reding@gmail.com> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1409065064-17617-1-git-send-email-thierry.reding@gmail.com> References: <1409065064-17617-1-git-send-email-thierry.reding@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Peter Daifuku The 16 chunks of 64 KiB that need to be stitched together to make up the configuration space for one bus (1 MiB) are located 24 bits (== 16 MiB) apart in physical address space. This is determined by the start of the extended register field (bits 24-27) in the physical mapping. Signed-off-by: Peter Daifuku Signed-off-by: Thierry Reding --- drivers/pci/host/pci-tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c index bd53b123218b..8264bce77750 100644 --- a/drivers/pci/host/pci-tegra.c +++ b/drivers/pci/host/pci-tegra.c @@ -383,7 +383,7 @@ static struct tegra_pcie_bus *tegra_pcie_bus_alloc(struct tegra_pcie *pcie, for (i = 0; i < 16; i++) { unsigned long virt = (unsigned long)bus->area->addr + i * SZ_64K; - phys_addr_t phys = cs + i * SZ_1M + busnr * SZ_64K; + phys_addr_t phys = cs + i * SZ_16M + busnr * SZ_64K; err = ioremap_page_range(virt, virt + SZ_64K, phys, prot); if (err < 0) {