Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3172112ybi; Fri, 5 Jul 2019 03:07:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTe1sp+iB/6sTZmMVE0csVgVsgUlUVM2R9FVazvYIL0BMDJjFK6nZ1TarcwUxWQ+3otaoV X-Received: by 2002:a17:902:8f87:: with SMTP id z7mr4372510plo.65.1562321274308; Fri, 05 Jul 2019 03:07:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562321274; cv=none; d=google.com; s=arc-20160816; b=X4vrK5psrDBgrJSttiWI9PltpWDL1gQzeX1n9GYxsHxea0xpT54zCoSXKDFk/x4+tx GTPySMzDBlY6+1iOrBnAtc5JXSoQVtFqfs1KBc8JYlmMbnwYYJZL/EOn6sRenSqkAiws luYzCEg9I5xaIZ0MP9n6OZz3PAH1g7AwE00GmT13Wfvdq+yGDlcGwMIcN69jXW2gs6tP f2LAof8Q6Fx1hR1TOj+7ROe/JJSnUUIE8cHwMUP3o700DASp+czA8VB0OVbo3/dLqqf3 UZEzYL3PD3V7zo2BKDwDDxrt6YnF1RPtdsojbJ23eYhAzJPTC675PdbJXgBMdDrmiIp7 wCtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=O8V50QXHPf+EjaFRCPThxPab/CiXjNQ1aww2AUNWfUA=; b=DNWvN5Tj1sKNPYlLfl7yCUz5Tk1Fpc7ijxqcbJzPWCGKzYSqkzqgzbiv7tqagjXhJP GA0wETeqKEme/D88Xc28JgghrLQyRaxZJIE4mYUzOMztdPby53xhJKBFfxb/up/WJjqG OVoB4UdBVFK+vYPXBcgvf61kJR8DRW0xuMURatG487/X3nJLOvfyMDqu4arBaxH40o/d Cht/MyCsdovhxwKcJa42A+fpuHoEh59GR6ukWM4HnIRVG3rqPJwHW4gRXbwdWV+R3/F0 MDOigm635v4/ccLdX7W+EcrzHx+CyJ5NVvLoqVeyPRCZtLXspHYyk8PmZ2B2g0IzrJua x/Tw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q7si7954320pgp.245.2019.07.05.03.07.38; Fri, 05 Jul 2019 03:07:54 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727910AbfGEKHM (ORCPT + 99 others); Fri, 5 Jul 2019 06:07:12 -0400 Received: from inva021.nxp.com ([92.121.34.21]:47928 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727760AbfGEKHK (ORCPT ); Fri, 5 Jul 2019 06:07:10 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 50AFF200E8B; Fri, 5 Jul 2019 12:07:08 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id C73FF2001B2; Fri, 5 Jul 2019 12:06:59 +0200 (CEST) Received: from titan.ap.freescale.net (TITAN.ap.freescale.net [10.192.208.233]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id E29EB402EB; Fri, 5 Jul 2019 18:06:48 +0800 (SGT) From: Hou Zhiqiang To: linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, bhelgaas@google.com, robh+dt@kernel.org, mark.rutland@arm.com, l.subrahmanya@mobiveil.co.in, shawnguo@kernel.org, leoyang.li@nxp.com, lorenzo.pieralisi@arm.com, catalin.marinas@arm.com, will.deacon@arm.com Cc: Mingkai.Hu@nxp.com, Minghuan.Lian@nxp.com, Xiaowei.Bao@nxp.com, Hou Zhiqiang Subject: [PATCHv6 03/28] PCI: mobiveil: Fix PCI base address in MEM/IO outbound windows Date: Fri, 5 Jul 2019 17:56:31 +0800 Message-Id: <20190705095656.19191-4-Zhiqiang.Hou@nxp.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20190705095656.19191-1-Zhiqiang.Hou@nxp.com> References: <20190705095656.19191-1-Zhiqiang.Hou@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The outbound memory windows PCI base addresses should be taken from the 'ranges' property of DT node to setup MEM/IO outbound windows decoding correctly instead of being hardcoded to zero. Update the code to retrieve the PCI base address for each range and use it to program the outbound windows address decoders Fixes: 9af6bcb11e12 ("PCI: mobiveil: Add Mobiveil PCIe Host Bridge IP driver") Signed-off-by: Hou Zhiqiang Signed-off-by: Lorenzo Pieralisi Reviewed-by: Minghuan Lian Reviewed-by: Subrahmanya Lingappa --- V6: - Rebased the patch, no functional change. drivers/pci/controller/pcie-mobiveil.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index e581902..53df317 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c @@ -621,8 +621,9 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) if (type) { /* configure outbound translation window */ program_ob_windows(pcie, pcie->ob_wins_configured, - win->res->start, 0, type, - resource_size(win->res)); + win->res->start, + win->res->start - win->offset, + type, resource_size(win->res)); } } -- 1.7.1